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


        info.setClassName(javaClass.getQualifiedName());
        Class restrictionClass = String.class;

        if (helper.isAnnotationPresent(javaClass, XmlEnum.class)) {
            XmlEnum xmlEnum = (XmlEnum) helper.getAnnotation(javaClass, XmlEnum.class);
            restrictionClass = xmlEnum.value();
        }
        QName restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));
        info.setRestrictionBase(restrictionBase);

        for (Iterator<JavaField> fieldIt = javaClass.getDeclaredFields().iterator(); fieldIt.hasNext();) {
View Full Code Here

                        // If we cannot find forName(String) then look for @XmlEnum value
                        // and then look for a forName with the indicated base type
                        if (log.isDebugEnabled()) {
                            log.debug("try looking for @XmlEnum ");
                        }
                        XmlEnum xmlEnum = (XmlEnum)
                            e.getAnnotation(XmlEnum.class);
                        if (xmlEnum != null) {
                            Class argClass = xmlEnum.value();
                            m = fromValueMethod(e, argClass);
                            if (m !=null) {
                                return argClass;
                            }
                            Class primitiveClass = getPrimitiveClass(argClass);
View Full Code Here

       
        // If cannot find forName(String) then look for @XmlEnum value
        if (log.isDebugEnabled()) {
            log.debug("try looking for @XmlEnum ");
        }
        XmlEnum xmlEnum = (XmlEnum)
            cls.getAnnotation(XmlEnum.class);
        if (xmlEnum != null) {
            Class argClass = xmlEnum.value();
            m = fromValueMethod(cls, argClass);
            if (m !=null) {
                return m;
            }
            Class primitiveClass = getPrimitiveClass(argClass);
View Full Code Here

            if (typeName.equals("##default")) {
                typeName = Introspector.decapitalize(javaType.getSimpleName());
            }
            typeQName = new QName(typeNamespace, typeName);
        } else {
            XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
            if (xmlEnum != null) {
                name = Introspector.decapitalize(javaType.getSimpleName());
                typeQName = new QName(namespace, name);
            }
        }
View Full Code Here

            if (typeName.equals("##default")) {
                typeName = Introspector.decapitalize(javaType.getSimpleName());
            }
            typeQName = new QName(typeNamespace, typeName);
        } else {
            XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class);
            if (xmlEnum != null) {
                name = Introspector.decapitalize(javaType.getSimpleName());
                typeQName = new QName(namespace, name);
            }
        }
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

        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);
            if (xmlEnum != null) {
                name = jaxbDecapitalize(javaType.getSimpleName());
                typeQName = new QName(namespace, name);
            }
        }
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.