Package com.sun.codemodel

Examples of com.sun.codemodel.JClass


 
  @SuppressWarnings("restriction")
  private void createBooleanConverter(final Outline outline) {
    final JDefinedClass booleanConverter = pool.getClassBooleanConverter();

    final JClass xmladapter = outline.getCodeModel().ref(XmlAdapter.class).narrow(Integer.class).narrow(Boolean.class);
    booleanConverter._extends(xmladapter);
   
    // toString
    final JMethod unmarshal = booleanConverter.method(JMod.PUBLIC, Boolean.class, "unmarshal");
    final JVar stringConstructorArg = unmarshal.param(JMod.FINAL, Integer.class, "i");
View Full Code Here


    // coordinateClassConverter = classFactory.createClass(kmlpackage, JMod.PUBLIC | JMod.FINAL, "CoordinatesConverter", null,
    // ClassType.CLASS);
    final JDefinedClass coordinateClassConverter = pool.getClassCoordinateConverter();
    final JDefinedClass coordinateClass = pool.getClassCoordinate();

    final JClass listGenericsCoordinates = outline.getCodeModel().ref(List.class).narrow(coordinateClass);
    final JClass arraylistGenericsCoordinates = outline.getCodeModel().ref(ArrayList.class).narrow(coordinateClass);
    final JClass xmladapter = outline.getCodeModel().ref(XmlAdapter.class).narrow(String.class).narrow(listGenericsCoordinates);
    coordinateClassConverter._extends(xmladapter);

    // final JMethod stringArgConstructor = coordinateClassConverter.constructor(JMod.PRIVATE);

    // toString
View Full Code Here

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

        final JDefinedClass candidateClass = cc.implClass;
        final JClass newInterfaceClass = candidateClass.owner().ref(interfaceClass).narrow(pool.getClassCoordinate());
        final JClass newCollectionClass = candidateClass.owner().ref(collectionClass).narrow(pool.getClassCoordinate());

        jFieldVar.type(newInterfaceClass);
        // Find original getter and setter methods to remove.
        final ArrayList<JMethod> methodsToRemove = new ArrayList<JMethod>();
        for (final JMethod m : candidateClass.methods()) {
View Full Code Here

  private void generateCreateAndSetCoordinatesMethod(final Outline outline, final ClassOutlineImpl cc, final JDefinedClass implClass, final JFieldVar fieldVar) {

    final StringBuffer debugOut = new StringBuffer();

    JClass jaxbElementClass = null;
    if (annotateCoordinates != null) {
      fieldVar.annotate(XmlElement.class).param("namespace", "http://www.opengis.net/kml/2.2").param("type", String.class);
      fieldVar.annotate(XmlJavaTypeAdapter.class).param("value", pool.getClassCoordinateConverter());
      jaxbElementClass = codeModel.ref(ArrayList.class).narrow(annotateCoordinates);
    }
View Full Code Here

                        writer.write("();");
                       
                        f = tp.getClass().getDeclaredField("args");
                        f.setAccessible(true);
                        List<JClass> lcl = CastUtils.cast((List)f.get(tp));
                        JClass cl = lcl.get(0);
                       
                        int cnt = defaultValues.getListLength(path + "/" + varName);
                        for (int x = 0; x < cnt; x++) {

                            writer.write("\n");
View Full Code Here

            }
        }
        public void fillInFields(Writer writer, String indent,
                                      String path, String varName,
                                      JDefinedClass tp) throws IOException {
            JClass sp = tp._extends();
            if (sp instanceof JDefinedClass) {
                fillInFields(writer, indent, path, varName, (JDefinedClass)sp);
            }
           
            Collection<JMethod> methods = tp.methods();
View Full Code Here

                        writer.write("();");

                        f = tp.getClass().getDeclaredField("args");
                        f.setAccessible(true);
                        List<JClass> lcl = CastUtils.cast((List)f.get(tp));
                        JClass cl = lcl.get(0);

                        int cnt = defaultValues.getListLength(path + "/" + varName);
                        for (int x = 0; x < cnt; x++) {

                            writer.write("\n");
View Full Code Here

            }
        }
        public void fillInFields(Writer writer, String indent,
                                      String path, String varName,
                                      JDefinedClass tp) throws IOException {
            JClass sp = tp._extends();
            if (sp instanceof JDefinedClass) {
                fillInFields(writer, indent, path, varName, (JDefinedClass)sp);
            }

            Collection<JMethod> methods = tp.methods();
View Full Code Here

                        writer.write("();");

                        f = tp.getClass().getDeclaredField("args");
                        f.setAccessible(true);
                        List<JClass> lcl = CastUtils.cast((List<?>)f.get(tp));
                        JClass cl = lcl.get(0);

                        int cnt = defaultValues.getListLength(path + "/" + varName);
                        for (int x = 0; x < cnt; x++) {

                            writer.write("\n");
View Full Code Here

            }
        }
        public void fillInFields(Writer writer, String indent,
                                      String path, String varName,
                                      JDefinedClass tp) throws IOException {
            JClass sp = tp._extends();
            if (sp instanceof JDefinedClass) {
                fillInFields(writer, indent, path, varName, (JDefinedClass)sp);
            }

            Collection<JMethod> methods = tp.methods();
View Full Code Here

TOP

Related Classes of com.sun.codemodel.JClass

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.