Java 类org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil 实例源码

项目:eclipse-avro    文件:XMLCalendar.java   
public XMLCalendar(String value, short datatype)
{
  value = XMLTypeUtil.normalize(value, true);
  if (value.length() == 0)
  {
    throw new InvalidDatatypeValueException("Incomplete value");
  }
  if (datatype < 0 || datatype > GMONTH)
  {
    throw new IllegalArgumentException("Illegal datatype value " + datatype);
  }

  if (datatype == GMONTH && FIX_GMONTH_PARSE)
  {
    if (value.length() < 6 || value.charAt(4) != '-' || value.charAt(5) != '-')
    {
      StringBuilder v = new StringBuilder(value);
      v.insert(4, "--");
      value = v.toString();
    }
  }

  this.date = null;
  this.dataType = datatype;
  this.xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(value);
}
项目:clickwatch    文件:XMLCalendar.java   
public XMLCalendar(String value, short datatype)
{
  value = XMLTypeUtil.normalize(value, true);
  if (value.length() == 0)
  {
    throw new InvalidDatatypeValueException("Incomplete value");
  }
  if (datatype < 0 || datatype > GMONTH)
  {
    throw new IllegalArgumentException("Illegal datatype value " + datatype);
  }

  if (datatype == GMONTH && FIX_GMONTH_PARSE)
  {
    if (value.length() < 6 || value.charAt(4) != '-' || value.charAt(5) != '-')
    {
      StringBuilder v = new StringBuilder(value);
      v.insert(4, "--");
      value = v.toString();
    }
  }

  this.date = null;
  this.dataType = datatype;
  this.xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(value);
}
项目:eclipse-avro    文件:XMLDuration.java   
public XMLDuration(String value)
{
  duration = XMLCalendar.datatypeFactory.newDuration(XMLTypeUtil.normalize(value, true));
}
项目:eclipse-avro    文件:EFactoryImpl.java   
protected String replaceWhiteSpace(String value)
{
  return XMLTypeUtil.normalize(value, false);
}
项目:eclipse-avro    文件:EFactoryImpl.java   
protected String collapseWhiteSpace(String value)
{
  return XMLTypeUtil.normalize(value, true);
}
项目:clickwatch    文件:XMLDuration.java   
public XMLDuration(String value)
{
  duration = XMLCalendar.datatypeFactory.newDuration(XMLTypeUtil.normalize(value, true));
}
项目:clickwatch    文件:EFactoryImpl.java   
protected String replaceWhiteSpace(String value)
{
  return XMLTypeUtil.normalize(value, false);
}
项目:clickwatch    文件:EFactoryImpl.java   
protected String collapseWhiteSpace(String value)
{
  return XMLTypeUtil.normalize(value, true);
}