Package com.sun.codemodel

Examples of com.sun.codemodel.JMethod.param()


    addConstructorParam(threeDoubleArgConstructor, longitude);
    addConstructorParam(threeDoubleArgConstructor, latitude);
    addConstructorParam(threeDoubleArgConstructor, altitude);

    final JMethod stringArgConstructor = coordinateClass.constructor(JMod.PUBLIC);
    final JVar stringConstructorArg = stringArgConstructor.param(JMod.FINAL, String.class, "coordinates");
   
    //    http://code.google.com/p/javaapiforkml/issues/detail?id=10
    //    changed:
    //      String[] coords = coordinates.replaceAll(",[ ]+?", ",").trim().split(",");
    //      to:
View Full Code Here


    final JFieldVar KML_20 = namespaceFilterHandler.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, stringClass, "KML_20", JExpr.lit("http://earth.google.com/kml/2.0"));
    final JFieldVar KML_21 = namespaceFilterHandler.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, stringClass, "KML_21", JExpr.lit("http://earth.google.com/kml/2.1"));
    final JFieldVar KML_22 = namespaceFilterHandler.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, stringClass, "KML_22", JExpr.lit("http://www.opengis.net/kml/2.2"));
    final JFieldVar content = namespaceFilterHandler.field(JMod.PRIVATE, contentHandlerClass, "contentHandler");
    final JMethod constructor = namespaceFilterHandler.constructor(JMod.PUBLIC);
    final JVar constructorParam = constructor.param(contentHandlerClass, "contentHandler");
    constructor.body().assign(JExpr._this().ref(content), constructorParam);
   
    final JMethod startElement = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "startElement");
    startElement._throws(SAXException.class);
    final JVar uri = startElement.param(stringClass, "uri");
View Full Code Here

    final JVar constructorParam = constructor.param(contentHandlerClass, "contentHandler");
    constructor.body().assign(JExpr._this().ref(content), constructorParam);
   
    final JMethod startElement = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "startElement");
    startElement._throws(SAXException.class);
    final JVar uri = startElement.param(stringClass, "uri");
    final JVar localName = startElement.param(stringClass, "localName");
    final JVar qName = startElement.param(stringClass, "qName");
    final JVar atts = startElement.param(Attributes.class, "atts");
    final JConditional if1 = startElement.body()._if(uri.invoke("equals").arg(KML_20).cor(uri.invoke("equals").arg(KML_21)));
    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
View Full Code Here

    constructor.body().assign(JExpr._this().ref(content), constructorParam);
   
    final JMethod startElement = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "startElement");
    startElement._throws(SAXException.class);
    final JVar uri = startElement.param(stringClass, "uri");
    final JVar localName = startElement.param(stringClass, "localName");
    final JVar qName = startElement.param(stringClass, "qName");
    final JVar atts = startElement.param(Attributes.class, "atts");
    final JConditional if1 = startElement.body()._if(uri.invoke("equals").arg(KML_20).cor(uri.invoke("equals").arg(KML_21)));
    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
    if1._else().block().add(content.invoke("startElement").arg(uri).arg(localName).arg(qName).arg(atts));
View Full Code Here

   
    final JMethod startElement = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "startElement");
    startElement._throws(SAXException.class);
    final JVar uri = startElement.param(stringClass, "uri");
    final JVar localName = startElement.param(stringClass, "localName");
    final JVar qName = startElement.param(stringClass, "qName");
    final JVar atts = startElement.param(Attributes.class, "atts");
    final JConditional if1 = startElement.body()._if(uri.invoke("equals").arg(KML_20).cor(uri.invoke("equals").arg(KML_21)));
    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
    if1._else().block().add(content.invoke("startElement").arg(uri).arg(localName).arg(qName).arg(atts));
   
View Full Code Here

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

    // toString
    final JMethod marshall = coordinateClassConverter.method(JMod.PUBLIC, String.class, "marshal");
    final JVar stringConstructorArg = marshall.param(JMod.FINAL, listGenericsCoordinates, "dt");
    marshall._throws(Exception.class);
    marshall.annotate(Override.class);
    final JVar sbVarMarshall = marshall.body().decl(stringBuilderClass, "sb", JExpr._new(stringBuilderClass));
    final JForEach forMarshall = marshall.body().forEach(coordinateClass, "coord", stringConstructorArg);
    // forMarshall.body().add(sbVarMarshall.invoke("append").arg(forMarshall.var().name() + " + \" \""));
View Full Code Here

    final JMethod startElement = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "startElement");
    startElement._throws(SAXException.class);
    final JVar uri = startElement.param(stringClass, "uri");
    final JVar localName = startElement.param(stringClass, "localName");
    final JVar qName = startElement.param(stringClass, "qName");
    final JVar atts = startElement.param(Attributes.class, "atts");
    final JConditional if1 = startElement.body()._if(uri.invoke("equals").arg(KML_20).cor(uri.invoke("equals").arg(KML_21)));
    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
    if1._else().block().add(content.invoke("startElement").arg(uri).arg(localName).arg(qName).arg(atts));
   
    final JMethod characters = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "characters");
View Full Code Here

    final JConditional if1 = startElement.body()._if(uri.invoke("equals").arg(KML_20).cor(uri.invoke("equals").arg(KML_21)));
    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
    if1._else().block().add(content.invoke("startElement").arg(uri).arg(localName).arg(qName).arg(atts));
   
    final JMethod characters = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "characters");
    final JVar charCh = characters.param(cc.implClass.owner().CHAR.array(), "ch");
    final JVar charStart = characters.param(cc.implClass.owner().INT, "start");
    final JVar charLength = characters.param(cc.implClass.owner().INT, "length");
    characters._throws(saxExceptionClass.boxify());
    characters.body().add(content.invoke("characters").arg(charCh).arg(charStart).arg(charLength));
   
View Full Code Here

    if1._then().block().add(content.invoke("startElement").arg(KML_22).arg(localName).arg(qName).arg(atts));
    if1._else().block().add(content.invoke("startElement").arg(uri).arg(localName).arg(qName).arg(atts));
   
    final JMethod characters = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "characters");
    final JVar charCh = characters.param(cc.implClass.owner().CHAR.array(), "ch");
    final JVar charStart = characters.param(cc.implClass.owner().INT, "start");
    final JVar charLength = characters.param(cc.implClass.owner().INT, "length");
    characters._throws(saxExceptionClass.boxify());
    characters.body().add(content.invoke("characters").arg(charCh).arg(charStart).arg(charLength));
   
    final JMethod endDocument = namespaceFilterHandler.method(JMod.PUBLIC, cc.implClass.owner().VOID, "endDocument");
View Full Code Here

      coordinateCreateMethods.clear();
     
      final JMethod m = objectFactory.method(JMod.PUBLIC | JMod.STATIC, sigType, "create" + methodName);
      m.javadoc().append("Create an instance of ").append(cc.ref);
      final JInvocation returntype = JExpr._new(cc.implRef);
      final JVar arg = m.param(JMod.FINAL, String.class, "coordinates");
      m.javadoc().addParam(arg).append("required parameter");
      returntype.arg(arg);
      m.body()._return(returntype);
      return;
    }
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.