Package com.sun.codemodel

Examples of com.sun.codemodel.JEnumConstant


                getErrorReceiver().error( e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));

            // [RESULT]
            // <Const>(...)
            // ASSUMPTION: datatype is outline-independent
            JEnumConstant constRef = type.enumConstant(constName);
            if(needsValue)
                constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));

            if(!mem.getLexicalValue().equals(constName))
                constRef.annotate2(XmlEnumValueWriter.class).value(mem.getLexicalValue());

            // set javadoc
            if( mem.javadoc!=null )
                constRef.javadoc().append(mem.javadoc);

            eo.constants.add(new EnumConstantOutline(mem,constRef){});
        }

View Full Code Here


      if (isReserved(value))
      {
        throw new IllegalArgumentException("Enum contains Java reserved symbol: " + value + " schema: " + schema);
      }

      JEnumConstant enumConstant = enumClass.enumConstant(value);

      String enumConstantDoc = schema.getSymbolDocs().get(value);

      if (enumConstantDoc != null)
      {
        enumConstant.javadoc().append(enumConstantDoc);
      }
      setDeprecatedAnnotationAndJavadoc(schema, value, enumConstant);
    }
    enumClass.enumConstant(DataTemplateUtil.UNKNOWN_ENUM);
View Full Code Here

                getErrorReceiver().error( e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));

            // [RESULT]
            // <Const>(...)
            // ASSUMPTION: datatype is outline-independent
            JEnumConstant constRef = type.enumConstant(constName);
            if(needsValue)
                constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));

            if(!mem.getLexicalValue().equals(constName))
                constRef.annotate2(XmlEnumValueWriter.class).value(mem.getLexicalValue());

            // set javadoc
            if( mem.javadoc!=null )
                constRef.javadoc().append(mem.javadoc);

            eo.constants.add(new EnumConstantOutline(mem,constRef){});
        }

View Full Code Here

    private void addEnumConstants(JsonNode node, JDefinedClass _enum) {
        for (Iterator<JsonNode> values = node.elements(); values.hasNext();) {
            JsonNode value = values.next();

            if (!value.isNull()) {
                JEnumConstant constant = _enum.enumConstant(getConstantName(value.asText()));
                constant.arg(JExpr.lit(value.asText()));
                ruleFactory.getAnnotator().enumConstant(constant, value.asText());
            }
        }
    }
View Full Code Here

            }

            // [RESULT]
            // <Const>(...)
            // ASSUMPTION: datatype is outline-independent
            JEnumConstant constRef = type.enumConstant(constName);
            if (needsValue) {
                constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
            }

            if (!mem.getLexicalValue().equals(constName)) {
                constRef.annotate2(XmlEnumValueWriter.class).value(mem.getLexicalValue());
            }

            // set javadoc
            if (mem.javadoc != null) {
                constRef.javadoc().append(mem.javadoc);
            }

            eo.constants.add(new EnumConstantOutline(mem, constRef) {
            });
        }
View Full Code Here

            }

            // [RESULT]
            // <Const>(...)
            // ASSUMPTION: datatype is outline-independent
            JEnumConstant constRef = type.enumConstant(constName);
            if (needsValue) {
                constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
            }

            if (!mem.getLexicalValue().equals(constName)) {
                constRef.annotate2(XmlEnumValueWriter.class).value(mem.getLexicalValue());
            }

            // set javadoc
            if (mem.javadoc != null) {
                constRef.javadoc().append(mem.javadoc);
            }

            eo.constants.add(new EnumConstantOutline(mem, constRef) {
            });
        }
View Full Code Here

TOP

Related Classes of com.sun.codemodel.JEnumConstant

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.