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

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

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

XMLGregorianCalendar.getEonAndYear介绍

[英]Return XML Schema 1.0 dateTime datatype field for year.

Value constraints for this value are summarized in year field of date/time field mapping table.
[中]返回year的XML Schema 1.0 dateTime数据类型字段。
此值的值约束汇总在year field of date/time field mapping table中。

代码示例

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

printNumber(buf,value.getEonAndYear(), 4);
  break;
case 'M':

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

printNumber(buf,value.getEonAndYear(), 4);
  break;
case 'M':

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

@Override
public BigInteger getEonAndYear()
{
 return xmlGregorianCalendar.getEonAndYear();
}

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

@Override
public BigInteger getEonAndYear()
{
 return xmlGregorianCalendar.getEonAndYear();
}

代码示例来源:origin: psidev.psi.mi/psi25-xml

public BigInteger getEonAndYear() {
  return calendar.getEonAndYear();
}

代码示例来源:origin: psidev.psi.mi/psi25-xml

public BigInteger getEonAndYear() {
  return calendar.getEonAndYear();
}

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) throws DatatypeConfigurationException {

  String inDate = "2011-03-16T09:00:00-05:00";

  javax.xml.datatype.DatatypeFactory factory = DatatypeFactory.newInstance();

  javax.xml.datatype.XMLGregorianCalendar xmlGregCal = factory.newXMLGregorianCalendar(inDate);

  java.util.GregorianCalendar gregCal = xmlGregCal.toGregorianCalendar();

  java.util.Date dateObj = gregCal.getTime();

  System.out.println("cal = " + xmlGregCal.toString());
  System.out.println("cal.year = " + xmlGregCal.getYear());
  System.out.println("cal.month = " + xmlGregCal.getMonth());
  System.out.println("cal.day = " + xmlGregCal.getDay());
  System.out.println("cal.hour = " + xmlGregCal.getHour());
  System.out.println("cal.minute = " + xmlGregCal.getMinute());
  System.out.println("cal.second = " + xmlGregCal.getSecond());
  System.out.println("cal.timezone = " + xmlGregCal.getTimezone());
  System.out.println("cal.eonAndYear = " + xmlGregCal.getEonAndYear());
}

代码示例来源:origin: Galigator/openllet

private static Number calendarToReal(final XMLGregorianCalendar c)
  BigInteger yrPlusOne = c.getEonAndYear();
  final BigInteger y = yrPlusOne == null ? BigInteger.valueOf(1971) : yrPlusOne.subtract(BigInteger.ONE);
  if (yrPlusOne == null)

代码示例来源:origin: Galigator/openllet

private static Number calendarToReal(final XMLGregorianCalendar c)
  BigInteger yrPlusOne = c.getEonAndYear();
  final BigInteger y = yrPlusOne == null ? BigInteger.valueOf(1971) : yrPlusOne.subtract(BigInteger.ONE);
  if (yrPlusOne == null)

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

private static Number calendarToReal(XMLGregorianCalendar c) {
  BigInteger yrPlusOne = c.getEonAndYear();
  final BigInteger y = (yrPlusOne == null)
    ? BigInteger.valueOf( 1971 )

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

BigInteger year = xgc.getEonAndYear();
if (year != null) {
  cal.set(Calendar.ERA, year.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);

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

BigInteger year = xgc.getEonAndYear();
if (year != null) {
  cal.set(Calendar.ERA, year.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);

代码示例来源:origin: com.goldmansachs.jdmn/jdmn-core

public static boolean isValidDateTime(XMLGregorianCalendar calendar) {
  if (calendar == null) {
    return false;
  }
  long year = calendar.getYear();
  BigInteger eonAndYear = calendar.getEonAndYear();
  if (eonAndYear != null) {
    year = eonAndYear.intValue();
  }
  return isValidDate(year, calendar.getMonth(), calendar.getDay())
      || isValidDate(year, calendar.getMonth(), calendar.getDay()) && isValidTime(calendar.getHour(), calendar.getMinute(), calendar.getSecond())
      ;
}

代码示例来源:origin: com.goldmansachs.jdmn/jdmn-core

public static boolean isValidDate(XMLGregorianCalendar calendar) {
  if (calendar == null) {
    return false;
  }
  long year = calendar.getYear();
  BigInteger eonAndYear = calendar.getEonAndYear();
  if (eonAndYear != null) {
    year = eonAndYear.intValue();
  }
  return
      isValidDate(year, calendar.getMonth(), calendar.getDay())
      && isUndefined(calendar.getHour())
      && isUndefined(calendar.getMinute())
      && isUndefined(calendar.getSecond())
      ;
}

代码示例来源:origin: goldmansachs/jdmn

public static boolean isValidDate(XMLGregorianCalendar calendar) {
  if (calendar == null) {
    return false;
  }
  long year = calendar.getYear();
  BigInteger eonAndYear = calendar.getEonAndYear();
  if (eonAndYear != null) {
    year = eonAndYear.intValue();
  }
  return
      isValidDate(year, calendar.getMonth(), calendar.getDay())
      && isUndefined(calendar.getHour())
      && isUndefined(calendar.getMinute())
      && isUndefined(calendar.getSecond())
      ;
}

代码示例来源:origin: goldmansachs/jdmn

public static boolean isValidDateTime(XMLGregorianCalendar calendar) {
  if (calendar == null) {
    return false;
  }
  long year = calendar.getYear();
  BigInteger eonAndYear = calendar.getEonAndYear();
  if (eonAndYear != null) {
    year = eonAndYear.intValue();
  }
  return isValidDate(year, calendar.getMonth(), calendar.getDay())
      || isValidDate(year, calendar.getMonth(), calendar.getDay()) && isValidTime(calendar.getHour(), calendar.getMinute(), calendar.getSecond())
      ;
}

代码示例来源:origin: apache/jena

result = compareField(P.getEonAndYear(), Q.getEonAndYear());
if (result != DatatypeConstants.EQUAL) {
  return result;

代码示例来源:origin: com.goldmansachs.jdmn/jdmn-core

result = compareField(lhs.getEonAndYear(), rhs.getEonAndYear());
if (result != DatatypeConstants.EQUAL) {
  return result;

代码示例来源:origin: goldmansachs/jdmn

result = compareField(lhs.getEonAndYear(), rhs.getEonAndYear());
if (result != DatatypeConstants.EQUAL) {
  return result;

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

result = compareField(P.getEonAndYear(), Q.getEonAndYear());
if (result != DatatypeConstants.EQUAL) {
  return result;

相关文章