Package com.sun.codemodel

Examples of com.sun.codemodel.JDefinedClass.fields()


 
 
  private void convertComplexTypesToSimpleTypes(final ClassOutlineImpl cc) {
    final JDefinedClass implClass = cc.implClass;
    // if no fields are present return
    if (implClass.fields().isEmpty()) {
      return;
    }
    final JType stringClass = cm._ref(String.class);
    replacedTypes = 0;
    replaceComplexTypes(implClass, "java.lang.Double", cm.DOUBLE);
View Full Code Here


  }
 
  private void annotateBooleanFieldsWithBooleanConverter(final ClassOutlineImpl cc) {
    final JDefinedClass implClass = cc.implClass;
    // if no fields are present return
    if (implClass.fields().isEmpty()) {
      return;
    }
   
    for (final JFieldVar jFieldVar : implClass.fields().values()) {
      if (jFieldVar.type().fullName().equals("java.lang.Boolean")) {
View Full Code Here

    // if no fields are present return
    if (implClass.fields().isEmpty()) {
      return;
    }
   
    for (final JFieldVar jFieldVar : implClass.fields().values()) {
      if (jFieldVar.type().fullName().equals("java.lang.Boolean")) {
        jFieldVar.annotate(XmlJavaTypeAdapter.class).param("value", pool.getClassBooleanConverter());
      }
    }
  }
View Full Code Here

        if (fieldOutline instanceof FieldOutline) {
          final CPropertyInfo property = fieldOutline.getPropertyInfo();

          final JCodeModel codeModel = classOutline.parent().getCodeModel();

          final JFieldVar currentField = implClass.fields().get(property.getName(false));

          // LOG.info("fieldType: " + currentField.name());
          // find the common type
          final JType currentFieldType = TypeUtil
              .getCommonBaseType(codeModel, listPossibleTypes((ClassOutlineImpl) classOutline, property));
View Full Code Here

    // JPackage kmlpackage = Util.getKmlClassPackage(outline);
    // CodeModelClassFactory classFactory = outline.getClassFactory();
    // coordinateClass = classFactory.createClass(kmlpackage, JMod.PUBLIC, "Coordinate", null, ClassType.CLASS);
    final JDefinedClass coordinateClass = pool.getClassCoordinate();

    longitude = coordinateClass.fields().get("longitude");
    latitude = coordinateClass.fields().get("latitude");
    altitude = coordinateClass.fields().get("altitude");

//    longitude.init(JExpr.lit(0.0d));
//    latitude.init(JExpr.lit(0.0d));
View Full Code Here

    // CodeModelClassFactory classFactory = outline.getClassFactory();
    // coordinateClass = classFactory.createClass(kmlpackage, JMod.PUBLIC, "Coordinate", null, ClassType.CLASS);
    final JDefinedClass coordinateClass = pool.getClassCoordinate();

    longitude = coordinateClass.fields().get("longitude");
    latitude = coordinateClass.fields().get("latitude");
    altitude = coordinateClass.fields().get("altitude");

//    longitude.init(JExpr.lit(0.0d));
//    latitude.init(JExpr.lit(0.0d));
//    altitude.init(JExpr.lit(0.0d));
View Full Code Here

    // coordinateClass = classFactory.createClass(kmlpackage, JMod.PUBLIC, "Coordinate", null, ClassType.CLASS);
    final JDefinedClass coordinateClass = pool.getClassCoordinate();

    longitude = coordinateClass.fields().get("longitude");
    latitude = coordinateClass.fields().get("latitude");
    altitude = coordinateClass.fields().get("altitude");

//    longitude.init(JExpr.lit(0.0d));
//    latitude.init(JExpr.lit(0.0d));
//    altitude.init(JExpr.lit(0.0d));
    // longitude = coordinateClass.field(JMod.PRIVATE, cm.DOUBLE, "longitu33de", JExpr.lit(0.0d));
View Full Code Here

  }

  private void convertComplexTypesToSimpleTypes(final ClassOutlineImpl cc) {
    final JDefinedClass implClass = cc.implClass;
    // if no fields are present return
    if (implClass.fields().isEmpty()) {
      return;
    }

    for (final JFieldVar jFieldVar : implClass.fields().values()) {
View Full Code Here

    // if no fields are present return
    if (implClass.fields().isEmpty()) {
      return;
    }

    for (final JFieldVar jFieldVar : implClass.fields().values()) {

      if (jFieldVar.name().equals("coordinates")) {
        LOG.info("1+++ " + cc.implRef.name() + " " + jFieldVar.type().name() + " " + jFieldVar.name());

        final JDefinedClass candidateClass = cc.implClass;
View Full Code Here

  private JType getWrapperType(JType typeClass, String local) throws GenerationException {
    JDefinedClass cls = (JDefinedClass) typeClass;

    local = replaceAndUpperCase(new StringBuffer(local));
   
    JFieldVar var = cls.fields().get(local);
    if (var == null) {
      local = "_" + local;
      var = cls.fields().get(local);
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.