javax.xml.datatype.XMLGregorianCalendar.getXMLSchemaType()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中javax.xml.datatype.XMLGregorianCalendar.getXMLSchemaType()方法的一些代码示例,展示了XMLGregorianCalendar.getXMLSchemaType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLGregorianCalendar.getXMLSchemaType()方法的具体详情如下:
包路径:javax.xml.datatype.XMLGregorianCalendar
类名称:XMLGregorianCalendar
方法名:getXMLSchemaType

XMLGregorianCalendar.getXMLSchemaType介绍

[英]Return the name of the XML Schema date/time type that this instance maps to. Type is computed based on fields that are set.
Required fields for XML Schema 1.0 Date/Time Datatypes.
(timezone is optional for all date/time datatypes)DatatypeyearmonthdayhourminutesecondDatatypeConstants#DATETIMEXXXXXXDatatypeConstants#DATEXXXDatatypeConstants#TIMEXXXDatatypeConstants#GYEARMONTHXXDatatypeConstants#GMONTHDAYXXDatatypeConstants#GYEARXDatatypeConstants#GMONTHXDatatypeConstants#GDAYX
[中]返回此实例映射到的XML架构日期/时间类型的名称。根据设置的字段计算类型。
XML Schema 1.0日期/时间数据类型的必填字段。
(时区对于所有日期/时间数据类型都是可选的)数据类型YearMonthDayHourminuteSecondDataTypeConstants#DATETIMEXXXXXXDatatypeConstants#DatexxDataTypeConstants#TimexxDataTypeConstants#GYEARMONTHXXDatatypeConstants#GYEARXDatatypeConstants#GmonthDataTypeConstants#GmonthDataTypeConstants#

代码示例

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

@Override
  public QName getTypeName(XMLGregorianCalendar cal) {
    return cal.getXMLSchemaType();
  }
});

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

@Override
  public QName getTypeName(XMLGregorianCalendar cal) {
    return cal.getXMLSchemaType();
  }
});

代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore

@Override
public QName getXMLSchemaType()
{
 return xmlGregorianCalendar.getXMLSchemaType();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

@Override
public QName getXMLSchemaType()
{
 return xmlGregorianCalendar.getXMLSchemaType();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

@Override
  public QName getTypeName(XMLGregorianCalendar cal) {
    return cal.getXMLSchemaType();
  }
});

代码示例来源:origin: marklogic/java-client-api

GDayValImpl(XMLGregorianCalendar value) {
  super("gDay");
  checkNull(value);
  checkType("gDay", value.getXMLSchemaType());
  this.value = value;
}
@Override

代码示例来源:origin: marklogic/java-client-api

GMonthDayValImpl(XMLGregorianCalendar value) {
  super("gMonthDay");
  checkNull(value);
  checkType("gMonthDay", value.getXMLSchemaType());
  this.value = value;
}
@Override

代码示例来源:origin: marklogic/java-client-api

GYearValImpl(XMLGregorianCalendar value) {
  super("gYear");
  checkNull(value);
  checkType("gYear", value.getXMLSchemaType());
  this.value = value;
}
@Override

代码示例来源:origin: org.ow2.authzforce/authzforce-ce-core-pdp-api

private static final XMLGregorianCalendar validate(final XMLGregorianCalendar time, final QName xmlSchemaDatatype)
{
  if (!time.getXMLSchemaType().equals(xmlSchemaDatatype))
  {
    throw new IllegalArgumentException(
        "Invalid Attribute Value '" + time + "' (actual XML schema type: " + time.getXMLSchemaType() + ")  for specified/expected Attribute DataType '" + xmlSchemaDatatype + '"');
  }
  return time;
}

代码示例来源:origin: com.github.ansell.pellet/pellet-common

public ATermAppl getLiteral(Object value) {
  if( value instanceof XMLGregorianCalendar ) {
    final XMLGregorianCalendar c = (XMLGregorianCalendar) value;
    if( !schemaType.equals( c.getXMLSchemaType() ) )
      throw new IllegalArgumentException();
    return ATermUtils.makeTypedLiteral( c.toXMLFormat(), getName() );
  }
  else
    throw new IllegalArgumentException();
}

代码示例来源:origin: net.sourceforge.owlapi/pellet-core-ignazio1977

public ATermAppl getLiteral(Object value) {
  if( value instanceof XMLGregorianCalendar ) {
    final XMLGregorianCalendar c = (XMLGregorianCalendar) value;
    if( !schemaType.equals( c.getXMLSchemaType() ) )
      throw new IllegalArgumentException();
    return ATermUtils.makeTypedLiteral( c.toXMLFormat(), getName() );
  }
  else
    throw new IllegalArgumentException();
}

代码示例来源:origin: org.openrdf.sesame/sesame-model

/**
 * Creates a literal for the specified calendar using a datatype appropriate
 * for the value indicated by {@link XMLGregorianCalendar#getXMLSchemaType()}.
 */
protected CalendarLiteral(XMLGregorianCalendar calendar) {
  super(calendar.toXMLFormat(), XMLDatatypeUtil.qnameToURI(calendar.getXMLSchemaType()));
  this.calendar = calendar;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Creates a literal for the specified calendar using a datatype appropriate for the value indicated by
 * {@link XMLGregorianCalendar#getXMLSchemaType()}.
 */
protected CalendarLiteral(XMLGregorianCalendar calendar) {
  super(calendar.toXMLFormat(), XMLDatatypeUtil.qnameToURI(calendar.getXMLSchemaType()));
  this.calendar = calendar;
}

代码示例来源:origin: eclipse/rdf4j

/**
 * Creates a literal for the specified calendar using a datatype appropriate for the value indicated by
 * {@link XMLGregorianCalendar#getXMLSchemaType()}.
 */
protected CalendarLiteral(XMLGregorianCalendar calendar) {
  super(calendar.toXMLFormat(), XMLDatatypeUtil.qnameToURI(calendar.getXMLSchemaType()));
  this.calendar = calendar;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

private String stringFromXMLGregorianCalendar(XMLGregorianCalendar cal, QName schemaTypeQName) {
  if(schemaTypeQName !=null && schemaTypeQName.equals(cal.getXMLSchemaType()) && schemaTypeQName != Constants.G_MONTH_QNAME){
   return cal.toXMLFormat();
  }
  GregorianCalendar gCal = cal.toGregorianCalendar();
  if(cal.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    gCal.clear(Calendar.ZONE_OFFSET);
  }
  return  stringFromCalendar(gCal, schemaTypeQName);
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

private String stringFromXMLGregorianCalendar(XMLGregorianCalendar cal, QName schemaTypeQName) {
  if(schemaTypeQName !=null && schemaTypeQName.equals(cal.getXMLSchemaType()) && schemaTypeQName != Constants.G_MONTH_QNAME){
   return cal.toXMLFormat();
  }
  GregorianCalendar gCal = cal.toGregorianCalendar();
  if(cal.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    gCal.clear(Calendar.ZONE_OFFSET);
  }        
  return  stringFromCalendar(gCal, schemaTypeQName);
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Calls {@link ValueFactory#createLiteral(String, IRI)} with the String-value of the supplied calendar
 * and the appropriate datatype as parameters.
 * 
 * @see XMLGregorianCalendar#toXMLFormat()
 * @see XMLGregorianCalendar#getXMLSchemaType()
 * @see XMLDatatypeUtil#qnameToURI(javax.xml.namespace.QName)
 */
@Override
public Literal createLiteral(XMLGregorianCalendar calendar) {
  return createLiteral(calendar.toXMLFormat(), XMLDatatypeUtil.qnameToURI(calendar.getXMLSchemaType()));
}

代码示例来源:origin: eclipse/rdf4j

/**
 * Calls {@link ValueFactory#createLiteral(String, IRI)} with the String-value of the supplied calendar
 * and the appropriate datatype as parameters.
 * 
 * @see XMLGregorianCalendar#toXMLFormat()
 * @see XMLGregorianCalendar#getXMLSchemaType()
 * @see XMLDatatypeUtil#qnameToURI(javax.xml.namespace.QName)
 */
@Override
public Literal createLiteral(XMLGregorianCalendar calendar) {
  return createLiteral(calendar.toXMLFormat(), XMLDatatypeUtil.qnameToURI(calendar.getXMLSchemaType()));
}

代码示例来源:origin: blazegraph/database

@Override
public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) {
  /*
   * Note: QName#toString() does not produce the right representation,
   * which is why we need to go through XMLDatatypeUtil.
   * 
   * @see https://sourceforge.net/apps/trac/bigdata/ticket/117
   */
  return new BigdataLiteralImpl(this, arg0.toString(),
      null/* languageCode */, createURI(XMLDatatypeUtil.qnameToURI(
          arg0.getXMLSchemaType()).stringValue()));
  
}

代码示例来源:origin: com.blazegraph/bigdata-core

@Override
public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) {
  /*
   * Note: QName#toString() does not produce the right representation,
   * which is why we need to go through XMLDatatypeUtil.
   * 
   * @see https://sourceforge.net/apps/trac/bigdata/ticket/117
   */
  return new BigdataLiteralImpl(this, arg0.toString(),
      null/* languageCode */, createURI(XMLDatatypeUtil.qnameToURI(
          arg0.getXMLSchemaType()).stringValue()));
  
}

相关文章