Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlEnumValue


    try {
      f = myEnum.getClass().getField(myEnum.name());
     
      f.setAccessible(true);
     
      XmlEnumValue xev = (XmlEnumValue) getAnnotation(f, XmlEnumValue.class);
      if (xev == null){
        value = f.getName();
      } else {
        value = xev.value();
      }
    } catch (SecurityException e) {
      value = null;
    } catch (NoSuchFieldException e) {
      value = null;
View Full Code Here


        if (value != null) {
            if (buffer.charAt(buffer.length() - 1) != '[') {
                buffer.append(", ");
            }
            if (value instanceof Enum<?>) try {
                final XmlEnumValue xml = value.getClass().getField(((Enum<?>) value).name()).getAnnotation(XmlEnumValue.class);
                if (xml != null) {
                    value = xml.value();
                }
            } catch (NoSuchFieldException e) {
                // Should never happen with Enums. But if it
                // happen anyway, this is not a fatal error.
                Logging.unexpectedException(XLink.class, "toString", e);
View Full Code Here

        try {
            f = myEnum.getClass().getField(myEnum.name());

            f.setAccessible(true);

            XmlEnumValue xev = (XmlEnumValue)getAnnotation(f, XmlEnumValue.class);
            if (xev == null) {
                value = f.getName();
            } else {
                value = xev.value();
            }
        } catch (SecurityException e) {
            value = null;
        } catch (NoSuchFieldException e) {
            value = null;
View Full Code Here

        try {
            f = myEnum.getClass().getField(myEnum.name());

            f.setAccessible(true);

            XmlEnumValue xev = (XmlEnumValue)getAnnotation(f, XmlEnumValue.class);
            if (xev == null) {
                value = f.getName();
            } else {
                value = xev.value();
            }
        } catch (SecurityException e) {
            value = null;
        } catch (NoSuchFieldException e) {
            value = null;
View Full Code Here

        try {
            f = myEnum.getClass().getField(myEnum.name());

            f.setAccessible(true);

            XmlEnumValue xev = (XmlEnumValue)getAnnotation(f, XmlEnumValue.class);
            if (xev == null) {
                value = f.getName();
            } else {
                value = xev.value();
            }
        } catch (SecurityException e) {
            value = null;
        } catch (NoSuchFieldException e) {
            value = null;
View Full Code Here

    try {
      f = myEnum.getClass().getField(myEnum.name());
     
      f.setAccessible(true);
     
      XmlEnumValue xev = f.getAnnotation(XmlEnumValue.class);
      if (xev == null){
        value = f.getName();
      } else {
        value = xev.value();
      }
    } catch (SecurityException e) {
      value = null;
    } catch (NoSuchFieldException e) {
      value = null;
View Full Code Here

    try {
      f = myEnum.getClass().getField(myEnum.name());
     
      f.setAccessible(true);
     
      XmlEnumValue xev = (XmlEnumValue) getAnnotation(f, XmlEnumValue.class);
      if (xev == null){
        value = f.getName();
      } else {
        value = xev.value();
      }
    } catch (SecurityException e) {
      value = null;
    } catch (NoSuchFieldException e) {
      value = null;
View Full Code Here

     */
    protected void calcConstants() {
        EnumConstantImpl<T,C,F,M> last = null;
        for( F constant : nav().getEnumConstants(clazz) ) {
            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

        EnumConstantImpl<T,C,F,M> last = null;
        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

        EnumConstantImpl<T,C,F,M> last = null;
        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.