Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlEnum


                name = Introspector.decapitalize(javaType.getSimpleName());
            } else {
                name = typeName;
            }
        } else {
            XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
            if (xmlEnum != null) {
                name = Introspector.decapitalize(javaType.getSimpleName());
            }
        }
        if (name == null) {
View Full Code Here


        // TODO: I guess it must be allowed for enums to have @XmlElement
        typeName = parseTypeName(clazz);

        // locate the base type.
        // this can be done eagerly because there shouldn't be no cycle.
        XmlEnum xe = builder.reader.getClassAnnotation(XmlEnum.class, clazz, this);
        if(xe!=null) {
            T base = builder.reader.getClassValue(xe, "value");
            baseType = builder.getTypeInfo(base,this);
        } else {
            baseType = builder.getTypeInfo(builder.nav.ref(String.class),this);
View Full Code Here

        // TODO: I guess it must be allowed for enums to have @XmlElement
        typeName = parseTypeName(clazz);

        // locate the base type.
        // this can be done eagerly because there shouldn't be no cycle.
        XmlEnum xe = builder.reader.getClassAnnotation(XmlEnum.class, clazz, this);
        if(xe!=null) {
            T base = builder.reader.getClassValue(xe, "value");
            baseType = builder.getTypeInfo(base,this);
        } else {
            baseType = builder.getTypeInfo(builder.nav.ref(String.class),this);
View Full Code Here

         overrideName = xmlType.name();
      }

      // Determine the enum type
      Class<?> xmlEnumValue = String.class;
      XmlEnum xmlEnum = typeInfo.getUnderlyingAnnotation(XmlEnum.class);
      if (xmlEnum != null)
         xmlEnumValue = xmlEnum.value();
      TypeInfo enumType = typeInfo.getTypeInfoFactory().getTypeInfo(xmlEnumValue);

      // Resolve the enum type as the parent (must be simple)
      TypeBinding parent = getSimpleType(enumType);
View Full Code Here

        info.setClassName(javaClass.getQualifiedName());
        Class restrictionClass = String.class;
        QName restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));

        if (helper.isAnnotationPresent(javaClass, XmlEnum.class)) {
            XmlEnum xmlEnum = (XmlEnum) helper.getAnnotation(javaClass, XmlEnum.class);
            restrictionClass = xmlEnum.value();
            JavaClass restrictionJavaClass= helper.getJavaClass(restrictionClass);

            boolean restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
            if(!restrictionIsEnum){
               restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));                 
            }else{
              while (restrictionIsEnum) {
               
                    TypeInfo restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
                    if(restrictionTypeInfo == null && shouldGenerateTypeInfo(restrictionJavaClass)){
                       JavaClass[] jClasses = new JavaClass[] { restrictionJavaClass };
                         buildNewTypeInfo(jClasses);
                         restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
                    }
                    restrictionBase = new QName(restrictionTypeInfo.getClassNamespace(), restrictionTypeInfo.getSchemaTypeName());
 
                   xmlEnum = (XmlEnum) helper.getAnnotation(restrictionJavaClass, XmlEnum.class);
                   restrictionClass = xmlEnum.value()
                   restrictionJavaClass= helper.getJavaClass(restrictionClass);
                   restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
              }
            }
        }
View Full Code Here

            if (typeName.equals("##default")) {
                typeName = jaxbDecapitalize(javaType.getSimpleName());
            }
            typeQName = new QName(typeNamespace, typeName);
        } else {
            XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
            // POJO can have the @XmlSchema on the package-info too
            if (xmlEnum != null || namespace != null) {
                name = jaxbDecapitalize(javaType.getSimpleName());
                typeQName = new QName(namespace, name);
            }
View Full Code Here

        // TODO: I guess it must be allowed for enums to have @XmlElement
        typeName = parseTypeName(clazz);

        // locate the base type.
        // this can be done eagerly because there shouldn't be no cycle.
        XmlEnum xe = builder.reader.getClassAnnotation(XmlEnum.class, clazz, this);
        if(xe!=null) {
            T base = builder.reader.getClassValue(xe, "value");
            baseType = builder.getTypeInfo(base,this);
        } else {
            baseType = builder.getTypeInfo(builder.nav.ref(String.class),this);
View Full Code Here

         overrideName = xmlType.name();
      }

      // Determine the enum type
      Class<?> xmlEnumValue = String.class;
      XmlEnum xmlEnum = typeInfo.getUnderlyingAnnotation(XmlEnum.class);
      if (xmlEnum != null)
         xmlEnumValue = xmlEnum.value();
      TypeInfo enumType = typeInfo.getTypeInfoFactory().getTypeInfo(xmlEnumValue);

      // Resolve the enum type as the parent (must be simple)
      TypeBinding parent = getSimpleType(enumType);
View Full Code Here

        info.setClassName(javaClass.getQualifiedName());
        Class restrictionClass = String.class;
        QName restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));

        if (helper.isAnnotationPresent(javaClass, XmlEnum.class)) {
            XmlEnum xmlEnum = (XmlEnum) helper.getAnnotation(javaClass, XmlEnum.class);
            restrictionClass = xmlEnum.value();
            JavaClass restrictionJavaClass= helper.getJavaClass(restrictionClass);

            boolean restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
            if(!restrictionIsEnum){
               restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));                 
            }else{
              while (restrictionIsEnum) {
               
                    TypeInfo restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
                    if(restrictionTypeInfo == null && shouldGenerateTypeInfo(restrictionJavaClass)){
                       JavaClass[] jClasses = new JavaClass[] { restrictionJavaClass };
                         buildNewTypeInfo(jClasses);
                         restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
                    }
                    restrictionBase = new QName(restrictionTypeInfo.getClassNamespace(), restrictionTypeInfo.getSchemaTypeName());
 
                   xmlEnum = (XmlEnum) helper.getAnnotation(restrictionJavaClass, XmlEnum.class);
                   restrictionClass = xmlEnum.value()
                   restrictionJavaClass= helper.getJavaClass(restrictionClass);
                   restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
              }
            }
        }
View Full Code Here

            if (typeName.equals("##default")) {
                typeName = jaxbDecapitalize(javaType.getSimpleName());
            }
            typeQName = new QName(typeNamespace, typeName);
        } else {
            XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
            // POJO can have the @XmlSchema on the package-info too
            if (xmlEnum != null || namespace != null) {
                name = jaxbDecapitalize(javaType.getSimpleName());
                typeQName = new QName(namespace, name);
            }
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.XmlEnum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.