Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlEnumValue


/* 121 */     EnumConstantImpl last = null;
/* 122 */     Object[] constants = nav().getEnumConstants(this.clazz);
/* 123 */     for (int i = constants.length - 1; i >= 0; i--) {
/* 124 */       Object constant = constants[i];
/* 125 */       String name = nav().getFieldName(constant);
/* 126 */       XmlEnumValue xev = (XmlEnumValue)this.builder.reader.getFieldAnnotation(XmlEnumValue.class, constant, this);
/*     */       String literal;
/*     */       String literal;
/* 129 */       if (xev == null) literal = name; else {
/* 130 */         literal = xev.value();
/*     */       }
/* 132 */       last = createEnumConstant(name, literal, constant, last);
/*     */     }
/* 134 */     this.firstConstant = last;
/*     */   }
View Full Code Here


      EnumConstantInfo[] constants = enumInfo.getEnumConstants();
      valid = new HashMap<Object, Object>(constants.length);
      for (EnumConstantInfo constant : constants)
      {
         String enumValue = constant.getName();
         XmlEnumValue xmlEnumValue = constant.getUnderlyingAnnotation(XmlEnumValue.class);
         if (xmlEnumValue != null)
            enumValue = xmlEnumValue.value();
        
         Object key;
         try
         {
            key = enumType.convertValue(enumValue, false);
View Full Code Here

        }
        F[] constants = nav().getEnumConstants(clazz);
        for( int i=constants.length-1; i>=0; i-- ) {
            F constant = constants[i];
            String name = nav().getFieldName(constant);
            XmlEnumValue xev = builder.reader.getFieldAnnotation(XmlEnumValue.class, constant, this);

            String literal;
            if(xev==null)   literal = name;
            else            literal = xev.value();

            last = createEnumConstant(name,literal,constant,last);
        }
        this.firstConstant = last;
    }
View Full Code Here

        // We only care about actual enum fields
        if (! fields[i].isEnumConstant())
          continue;

        XmlEnumValue xmlEnumValue = f.getAnnotation(XmlEnumValue.class);
        E value = Enum.valueOf(_enum, f.getName());

        if (xmlEnumValue != null) {
          _valueMap.put(xmlEnumValue.value(), value);
          _nameMap.put(value, xmlEnumValue.value());
        }
        else {
          _valueMap.put(f.getName(), value);
          _nameMap.put(value, f.getName());
        }
View Full Code Here

        }
        F[] constants = nav().getEnumConstants(clazz);
        for( int i=constants.length-1; i>=0; i-- ) {
            F constant = constants[i];
            String name = nav().getFieldName(constant);
            XmlEnumValue xev = builder.reader.getFieldAnnotation(XmlEnumValue.class, constant, this);

            String literal;
            if(xev==null)   literal = name;
            else            literal = xev.value();

            last = createEnumConstant(name,literal,constant,last);
        }
        this.firstConstant = last;
    }
View Full Code Here

TOP

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

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.