当前位置: 首页>>代码示例>>Java>>正文


Java XmlSchemaType类代码示例

本文整理汇总了Java中javax.xml.bind.annotation.XmlSchemaType的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaType类的具体用法?Java XmlSchemaType怎么用?Java XmlSchemaType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XmlSchemaType类属于javax.xml.bind.annotation包,在下文中一共展示了XmlSchemaType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeFromAnnotation

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@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
   }
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:20,代码来源:AnnotationUtilTest.java

示例2: valueFromAnnotation

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@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
   }
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:21,代码来源:AnnotationUtilTest.java

示例3: calcSchemaType

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:Util.java

示例4: findTypeNameUncached

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
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;
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:31,代码来源:PrismBeanInspector.java

示例5: findTypeNameUncached

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
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;
  }
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:35,代码来源:PrismBeanInspector.java

示例6: XmlSchemaTypeQuick

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
    super(upstream);
    this.core = core;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:XmlSchemaTypeQuick.java

示例7: newInstance

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
protected Quick newInstance(Locatable upstream, Annotation core) {
    return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XmlSchemaTypeQuick.java

示例8: annotationType

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
public Class<XmlSchemaType> annotationType() {
    return XmlSchemaType.class;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XmlSchemaTypeQuick.java

示例9: getTime

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:Devexperts,项目名称:QD,代码行数:11,代码来源:TheoPrice.java

示例10: getTime

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Devexperts,项目名称:QD,代码行数:11,代码来源:TradeBase.java

示例11: getCreate

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@XmlSchemaType(name = "dateTime")
@XmlElement(name = ImportResourceApi.IMPORT_BATCH_CREATE)
@Override
public abstract Timestamp getCreate();
 
开发者ID:proarc,项目名称:proarc,代码行数:5,代码来源:AnnotatedBatchView.java

示例12: getTimestamp

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@XmlSchemaType(name = "dateTime")
@XmlElement(name = ImportResourceApi.IMPORT_BATCH_TIMESTAMP)
@Override
public abstract Timestamp getTimestamp();
 
开发者ID:proarc,项目名称:proarc,代码行数:5,代码来源:AnnotatedBatchView.java

示例13: setCredentialIssueDate

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setCredentialIssueDate(DateTime credentialIssueDate) {
    this.credentialIssueDate = credentialIssueDate;
}
 
开发者ID:motech,项目名称:modules,代码行数:7,代码来源:Credential.java

示例14: setCredentialRenewalDate

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setCredentialRenewalDate(DateTime credentialRenewalDate) {
    this.credentialRenewalDate = credentialRenewalDate;
}
 
开发者ID:motech,项目名称:modules,代码行数:7,代码来源:Credential.java

示例15: setDateOfBirth

import javax.xml.bind.annotation.XmlSchemaType; //导入依赖的package包/类
@XmlElement
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(type = DateTime.class, value = DateAdapter.class)
public void setDateOfBirth(DateTime dateOfBirth) {
    this.dateOfBirth = dateOfBirth;
}
 
开发者ID:motech,项目名称:modules,代码行数:7,代码来源:Person.java


注:本文中的javax.xml.bind.annotation.XmlSchemaType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。