javax.xml.bind.annotation.XmlSchemaTypes类的使用及代码示例

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

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

XmlSchemaTypes介绍

暂无

代码示例

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

  1. static <T,C,F,M> QName calcSchemaType(
  2. AnnotationReader<T,C,F,M> reader,
  3. AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {
  4. XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
  5. if(xst!=null) {
  6. return new QName(xst.namespace(),xst.name());
  7. }
  8. // check the defaulted annotation
  9. XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
  10. XmlSchemaType[] values = null;
  11. if(xsts!=null)
  12. values = xsts.value();
  13. else {
  14. xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
  15. if(xst!=null) {
  16. values = new XmlSchemaType[1];
  17. values[0] = xst;
  18. }
  19. }
  20. if(values!=null) {
  21. for( XmlSchemaType item : values ) {
  22. if(reader.getClassValue(item,"type").equals(individualType)) {
  23. return new QName(item.namespace(),item.name());
  24. }
  25. }
  26. }
  27. return null;
  28. }

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

  1. static <T,C,F,M> QName calcSchemaType(
  2. AnnotationReader<T,C,F,M> reader,
  3. AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {
  4. XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
  5. if(xst!=null) {
  6. return new QName(xst.namespace(),xst.name());
  7. }
  8. // check the defaulted annotation
  9. XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
  10. XmlSchemaType[] values = null;
  11. if(xsts!=null)
  12. values = xsts.value();
  13. else {
  14. xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
  15. if(xst!=null) {
  16. values = new XmlSchemaType[1];
  17. values[0] = xst;
  18. }
  19. }
  20. if(values!=null) {
  21. for( XmlSchemaType item : values ) {
  22. if(reader.getClassValue(item,"type").equals(individualType)) {
  23. return new QName(item.namespace(),item.name());
  24. }
  25. }
  26. }
  27. return null;
  28. }

代码示例来源:origin: stoicflame/enunciate

  1. allSpecifiedTypes.addAll(Arrays.asList(schemaTypes.value()));

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

  1. allSpecifiedTypes.addAll(Arrays.asList(schemaTypes.value()));

代码示例来源:origin: apache/servicemix-bundles

  1. static <T,C,F,M> QName calcSchemaType(
  2. AnnotationReader<T,C,F,M> reader,
  3. AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {
  4. XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
  5. if(xst!=null) {
  6. return new QName(xst.namespace(),xst.name());
  7. }
  8. // check the defaulted annotation
  9. XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
  10. XmlSchemaType[] values = null;
  11. if(xsts!=null)
  12. values = xsts.value();
  13. else {
  14. xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
  15. if(xst!=null) {
  16. values = new XmlSchemaType[1];
  17. values[0] = xst;
  18. }
  19. }
  20. if(values!=null) {
  21. for( XmlSchemaType item : values ) {
  22. if(reader.getClassValue(item,"type").equals(individualType)) {
  23. return new QName(item.namespace(),item.name());
  24. }
  25. }
  26. }
  27. return null;
  28. }

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

  1. static <T,C,F,M> QName calcSchemaType(
  2. AnnotationReader<T,C,F,M> reader,
  3. AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src ) {
  4. XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
  5. if(xst!=null) {
  6. return new QName(xst.namespace(),xst.name());
  7. }
  8. // check the defaulted annotation
  9. XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class,enclosingClass,src);
  10. XmlSchemaType[] values = null;
  11. if(xsts!=null)
  12. values = xsts.value();
  13. else {
  14. xst = reader.getPackageAnnotation(XmlSchemaType.class,enclosingClass,src);
  15. if(xst!=null) {
  16. values = new XmlSchemaType[1];
  17. values[0] = xst;
  18. }
  19. }
  20. if(values!=null) {
  21. for( XmlSchemaType item : values ) {
  22. if(reader.getClassValue(item,"type").equals(individualType)) {
  23. return new QName(item.namespace(),item.name());
  24. }
  25. }
  26. }
  27. return null;
  28. }

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

  1. allSpecifiedTypes.addAll(Arrays.asList(schemaTypes.value()));

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

  1. allSpecifiedTypes.addAll(Arrays.asList(schemaTypes.value()));

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

  1. /**
  2. * Process any @XmlSchemaType(s).
  3. *
  4. * @param javaClass
  5. * @param info
  6. */
  7. private void processSchemaTypes(JavaClass javaClass, TypeInfo info) {
  8. JavaPackage pack = javaClass.getPackage();
  9. if (helper.isAnnotationPresent(pack, XmlSchemaTypes.class)) {
  10. XmlSchemaTypes types = (XmlSchemaTypes) helper.getAnnotation(pack, XmlSchemaTypes.class);
  11. XmlSchemaType[] typeArray = types.value();
  12. for (XmlSchemaType next : typeArray) {
  13. processSchemaType(next);
  14. }
  15. } else if (helper.isAnnotationPresent(pack, XmlSchemaType.class)) {
  16. processSchemaType((XmlSchemaType) helper.getAnnotation(pack, XmlSchemaType.class));
  17. }
  18. }

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

  1. /**
  2. * Process any @XmlSchemaType(s).
  3. *
  4. * @param javaClass
  5. * @param info
  6. */
  7. private void processSchemaTypes(JavaClass javaClass, TypeInfo info) {
  8. JavaPackage pack = javaClass.getPackage();
  9. if (helper.isAnnotationPresent(pack, XmlSchemaTypes.class)) {
  10. XmlSchemaTypes types = (XmlSchemaTypes) helper.getAnnotation(pack, XmlSchemaTypes.class);
  11. XmlSchemaType[] typeArray = types.value();
  12. for (XmlSchemaType next : typeArray) {
  13. processSchemaType(next);
  14. }
  15. } else if (helper.isAnnotationPresent(pack, XmlSchemaType.class)) {
  16. processSchemaType((XmlSchemaType) helper.getAnnotation(pack, XmlSchemaType.class));
  17. }
  18. }

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

  1. public ValidationResult validatePackage(Schema schema) {
  2. ValidationResult result = new ValidationResult();
  3. XmlSchemaType schemaType = schema.getAnnotation(XmlSchemaType.class);
  4. if (schemaType != null) {
  5. try {
  6. if (schemaType.type() == XmlSchemaType.DEFAULT.class) {
  7. result.addError(schema, "A type must be specified at the package-level for @XmlSchemaType.");
  8. }
  9. }
  10. catch (MirroredTypeException e) {
  11. //fall through. Implies the type was set.
  12. }
  13. }
  14. XmlSchemaTypes schemaTypes = schema.getAnnotation(XmlSchemaTypes.class);
  15. if (schemaTypes != null) {
  16. for (XmlSchemaType xmlSchemaType : schemaTypes.value()) {
  17. try {
  18. if (xmlSchemaType.type() == XmlSchemaType.DEFAULT.class) {
  19. result.addError(schema, "A type must be specified at the package-level for all types of @XmlSchemaTypes.");
  20. }
  21. }
  22. catch (MirroredTypeException e) {
  23. //fall through. Implies the type was set.
  24. }
  25. }
  26. }
  27. return result;
  28. }

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

  1. public ValidationResult validatePackage(Schema schema) {
  2. ValidationResult result = new ValidationResult();
  3. XmlSchemaType schemaType = schema.getAnnotation(XmlSchemaType.class);
  4. if (schemaType != null) {
  5. try {
  6. if (schemaType.type() == XmlSchemaType.DEFAULT.class) {
  7. result.addError(schema.getPosition(), "A type must be specified at the package-level for @XmlSchemaType.");
  8. }
  9. }
  10. catch (MirroredTypeException e) {
  11. //fall through. Implies the type was set.
  12. }
  13. }
  14. XmlSchemaTypes schemaTypes = schema.getAnnotation(XmlSchemaTypes.class);
  15. if (schemaTypes != null) {
  16. for (XmlSchemaType xmlSchemaType : schemaTypes.value()) {
  17. try {
  18. if (xmlSchemaType.type() == XmlSchemaType.DEFAULT.class) {
  19. result.addError(schema.getPosition(), "A type must be specified at the package-level for all types of @XmlSchemaTypes.");
  20. }
  21. }
  22. catch (MirroredTypeException e) {
  23. //fall through. Implies the type was set.
  24. }
  25. }
  26. }
  27. return result;
  28. }

相关文章

XmlSchemaTypes类方法