Java 类javax.xml.bind.annotation.XmlSchemaType 实例源码

项目:cibet    文件:AnnotationUtilTest.java   
@Test
public void typeFromAnnotation() {
   log.debug("start AnnotationUtilTest");
   Class<?> a = AnnotationUtil.getTypeOfAnnotatedFieldOrMethod(Sub4EyesController.class, XmlValue.class);
   Assert.assertTrue(a == long.class);

   Class<?> b = AnnotationUtil.getTypeOfAnnotatedFieldOrMethod(Sub4EyesController.class, XmlTransient.class);
   Assert.assertTrue(b == boolean.class);

   Class<?> b1 = AnnotationUtil.getTypeOfAnnotatedFieldOrMethod(CoreTestBase.class, AfterClass.class);
   Assert.assertTrue(b1 == void.class);

   try {
      AnnotationUtil.getTypeOfAnnotatedFieldOrMethod(Sub4EyesController.class, XmlSchemaType.class);
      Assert.fail();
   } catch (AnnotationNotFoundException e) {
      // okay, annotation is not present
   }
}
项目:cibet    文件:AnnotationUtilTest.java   
@Test
public void valueFromAnnotation() {
   Sub4EyesController contr = new Sub4EyesController();
   Object o1 = AnnotationUtil.getValueOfAnnotatedFieldOrMethod(contr, XmlValue.class);
   Assert.assertTrue((Long) o1 == 43);

   Object o2 = AnnotationUtil.getValueOfAnnotatedFieldOrMethod(contr, XmlTransient.class);
   Assert.assertTrue((Boolean) o2 == true);

   ConfigurationTest test = new ConfigurationTest();
   Object o4 = AnnotationUtil.getValueOfAnnotatedFieldOrMethod(test, AfterClass.class);
   Assert.assertTrue(o4 == null);

   try {
      AnnotationUtil.getValueOfAnnotatedFieldOrMethod(contr, XmlSchemaType.class);
      Assert.fail();
   } catch (AnnotationNotFoundException e) {
      // okay, annotation is not present
   }
}
项目:OpenJSharp    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:openjdk-jdk10    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:openjdk9    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:engerek    文件:PrismBeanInspector.java   
private QName findTypeNameUncached(Field field, Class contentClass, String schemaNamespace) {
      if (field != null) {
    XmlSchemaType xmlSchemaType = field.getAnnotation(XmlSchemaType.class);
          if (xmlSchemaType != null) {
              return new QName(xmlSchemaType.namespace(), xmlSchemaType.name());
          }
      }
      QName typeName = XsdTypeMapper.getJavaToXsdMapping(contentClass);
      if (typeName != null) {
        return typeName;
}
// TODO the following code is similar to determineTypeForClass
XmlType xmlType = (XmlType) contentClass.getAnnotation(XmlType.class);
if (xmlType != null) {
    String propTypeLocalPart = xmlType.name();
    String propTypeNamespace = xmlType.namespace();
    if (propTypeNamespace.equals(BeanMarshaller.DEFAULT_PLACEHOLDER)) {
        PrismSchema schema = prismContext.getSchemaRegistry().findSchemaByCompileTimeClass(contentClass);
        if (schema != null && schema.getNamespace() != null) {
            propTypeNamespace = schema.getNamespace();      // should be non-null for properly initialized schemas
        } else {
            // schemaNamespace is only a poor indicator of required namespace (consider e.g. having c:UserType in apit:ObjectListType)
            // so we use it only if we couldn't find anything else
            propTypeNamespace = schemaNamespace;
        }
    }
    return new QName(propTypeNamespace, propTypeLocalPart);
}
return null;
  }
项目:lookaside_java-1.8.0-openjdk    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:infobip-open-jdk-8    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:cxf-plus    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:midpoint    文件:PrismBeanInspector.java   
private QName findTypeNameUncached(Field field, Class contentClass, String schemaNamespace) {
    if (RawType.class.equals(contentClass)) {
        // RawType is a meta-type. We do not really want to use field types of RawType class.
        return null;
    }
      if (field != null) {
    XmlSchemaType xmlSchemaType = field.getAnnotation(XmlSchemaType.class);
          if (xmlSchemaType != null) {
              return new QName(xmlSchemaType.namespace(), xmlSchemaType.name());
          }
      }
      QName typeName = XsdTypeMapper.getJavaToXsdMapping(contentClass);
      if (typeName != null) {
        return typeName;
}
// TODO the following code is similar to determineTypeForClass
XmlType xmlType = (XmlType) contentClass.getAnnotation(XmlType.class);
if (xmlType != null) {
    String propTypeLocalPart = xmlType.name();
    String propTypeNamespace = xmlType.namespace();
    if (propTypeNamespace.equals(BeanMarshaller.DEFAULT_PLACEHOLDER)) {
        PrismSchema schema = prismContext.getSchemaRegistry().findSchemaByCompileTimeClass(contentClass);
        if (schema != null && schema.getNamespace() != null) {
            propTypeNamespace = schema.getNamespace();      // should be non-null for properly initialized schemas
        } else {
            // schemaNamespace is only a poor indicator of required namespace (consider e.g. having c:UserType in apit:ObjectListType)
            // so we use it only if we couldn't find anything else
            propTypeNamespace = schemaNamespace;
        }
    }
    return new QName(propTypeNamespace, propTypeLocalPart);
}
return null;
  }
项目:OLD-OpenJDK8    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:openjdk-icedtea7    文件:Util.java   
static <T,C,F,M> QName calcSchemaType(
        AnnotationReader<T,C,F,M> reader,
        AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {

    XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
    if(xst!=null) {
        return new QName(xst.namespace(),xst.name());
    }

    // check the defaulted annotation
    XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
    XmlSchemaType[] values = null;
    if(xsts!=null)
        values = xsts.value();
    else {
        xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
        if(xst!=null) {
            values = new XmlSchemaType[1];
            values[0] = xst;
        }
    }
    if(values!=null) {
        for( XmlSchemaType item : values ) {
            if(reader.getClassValue(item,"type").equals(individualType)) {
                return new QName(item.namespace(),item.name());
            }
        }
    }

    return null;
}
项目:midpoint    文件:PrismBeanInspector.java   
private QName findTypeNameUncached(Field field, Class contentClass, String schemaNamespace) {
    if (RawType.class.equals(contentClass)) {
        // RawType is a meta-type. We do not really want to use field types of RawType class.
        return null;
    }
      if (field != null) {
    XmlSchemaType xmlSchemaType = field.getAnnotation(XmlSchemaType.class);
          if (xmlSchemaType != null) {
              return new QName(xmlSchemaType.namespace(), xmlSchemaType.name());
          }
      }
      QName typeName = XsdTypeMapper.getJavaToXsdMapping(contentClass);
      if (typeName != null) {
        return typeName;
}
// TODO the following code is similar to determineTypeForClass
XmlType xmlType = (XmlType) contentClass.getAnnotation(XmlType.class);
if (xmlType != null) {
    String propTypeLocalPart = xmlType.name();
    String propTypeNamespace = xmlType.namespace();
    if (propTypeNamespace.equals(BeanMarshaller.DEFAULT_PLACEHOLDER)) {
        PrismSchema schema = prismContext.getSchemaRegistry().findSchemaByCompileTimeClass(contentClass);
        if (schema != null && schema.getNamespace() != null) {
            propTypeNamespace = schema.getNamespace();      // should be non-null for properly initialized schemas
        } else {
            // schemaNamespace is only a poor indicator of required namespace (consider e.g. having c:UserType in apit:ObjectListType)
            // so we use it only if we couldn't find anything else
            propTypeNamespace = schemaNamespace;
        }
    }
    return new QName(propTypeNamespace, propTypeLocalPart);
}
return null;
  }
项目:OpenJSharp    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:OpenJSharp    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:OpenJSharp    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:openjdk-jdk10    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:openjdk-jdk10    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:openjdk-jdk10    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:openjdk9    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:openjdk9    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:openjdk9    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:QD    文件:TheoPrice.java   
/**
 * Returns time of the last theo price computation.
 * Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
 * @return time of the last theo price computation.
 */
@XmlJavaTypeAdapter(type=long.class, value=XmlTimeAdapter.class)
@XmlSchemaType(name="dateTime")
public long getTime() {
    return time;
}
项目:QD    文件:TradeBase.java   
/**
 * Returns time of the last trade.
 * Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
 * @return time of the last trade.
 */
@XmlJavaTypeAdapter(type=long.class, value=XmlTimeAdapter.class)
@XmlSchemaType(name="dateTime")
public long getTime() {
    return (timeSequence >> 32) * 1000 + ((timeSequence >> 22) & 0x3ff);
}
项目:lookaside_java-1.8.0-openjdk    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:lookaside_java-1.8.0-openjdk    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:lookaside_java-1.8.0-openjdk    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:proarc    文件:AnnotatedBatchView.java   
@XmlSchemaType(name = "dateTime")
@XmlElement(name = ImportResourceApi.IMPORT_BATCH_CREATE)
@Override
public abstract Timestamp getCreate();
项目:proarc    文件:AnnotatedBatchView.java   
@XmlSchemaType(name = "dateTime")
@XmlElement(name = ImportResourceApi.IMPORT_BATCH_TIMESTAMP)
@Override
public abstract Timestamp getTimestamp();
项目:infobip-open-jdk-8    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:infobip-open-jdk-8    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:infobip-open-jdk-8    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:cxf-plus    文件:XmlSchemaTypeQuick.java   
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
项目:cxf-plus    文件:XmlSchemaTypeQuick.java   
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
项目:cxf-plus    文件:XmlSchemaTypeQuick.java   
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
项目:modules    文件:Credential.java   
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setCredentialIssueDate(DateTime credentialIssueDate) {
    this.credentialIssueDate = credentialIssueDate;
}
项目:modules    文件:Credential.java   
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setCredentialRenewalDate(DateTime credentialRenewalDate) {
    this.credentialRenewalDate = credentialRenewalDate;
}
项目:modules    文件:Person.java   
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setDateOfBirth(DateTime dateOfBirth) {
    this.dateOfBirth = dateOfBirth;
}
项目:modules    文件:OperatingHours.java   
@XmlElement(name = "dayOfTheWeek")
@XmlSchemaType(name = "integer")
@XmlJavaTypeAdapter(type = DayOfTheWeek.class, value = DayOfTheWeekAdapter.class)
public void setDaysOfTheWeek(List<DayOfTheWeek> daysOfTheWeek) {
    this.daysOfTheWeek = daysOfTheWeek;
}
项目:modules    文件:OperatingHours.java   
@XmlElement
@XmlSchemaType(name = "time")
@XmlJavaTypeAdapter(type = DateTime.class, value = TimeAdapter.class)
public void setBeginningHour(DateTime beginningHour) {
    this.beginningHour = beginningHour;
}