Package com.sun.codemodel

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


    getProperty.body()._return(xmlReader.invoke("getProperty").arg(getPropertyName));
   
    final JMethod parse = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "parse");
    final JVar parseInput = parse.param(InputSource.class, "input");
    parse._throws(IOException.class)._throws(SAXException.class);
    parse.body().add(xmlReader.invoke("parse").arg(parseInput));
   
    final JMethod parse2 = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "parse");
    final JVar parseSystemId = parse2.param(String.class, "systemId");
    parse2._throws(IOException.class)._throws(SAXException.class);
    parse2.body().add(xmlReader.invoke("parse").arg(parseSystemId));
View Full Code Here


    parse.body().add(xmlReader.invoke("parse").arg(parseInput));
   
    final JMethod parse2 = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "parse");
    final JVar parseSystemId = parse2.param(String.class, "systemId");
    parse2._throws(IOException.class)._throws(SAXException.class);
    parse2.body().add(xmlReader.invoke("parse").arg(parseSystemId));
   
    final JMethod setContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setContentHandler");
    final JVar setContentHandlerHandler = setContentHandler.param(ContentHandler.class, "handler");
    setContentHandler.body().add(xmlReader.invoke("setContentHandler").arg(JExpr._new(namespaceFilterHandler).arg(setContentHandlerHandler)));
   
View Full Code Here

        generateSet.annotate(annotateObvicious);
      }
      generateSet.annotate(Override.class);
      // super.setObjectSimpleExtensionGroup(objectSimpleExtensionGroup);
      // generateSet.body().assign(JExpr._this().ref(field.name()), value);
      generateSet.body().directStatement("super.set" + Util.upperFirst(field.name()) + "(" + value.name() + ");");
    } else {
      generateSet.javadoc().append("Sets the value of the " + field.name() + " property");
      generateSet.javadoc().addParam(value);
      generateSet.javadoc().append("Objects of the following type(s) are allowed in the list ");
      generateSet.javadoc().append(field.type().name());
View Full Code Here

    parse2._throws(IOException.class)._throws(SAXException.class);
    parse2.body().add(xmlReader.invoke("parse").arg(parseSystemId));
   
    final JMethod setContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setContentHandler");
    final JVar setContentHandlerHandler = setContentHandler.param(ContentHandler.class, "handler");
    setContentHandler.body().add(xmlReader.invoke("setContentHandler").arg(JExpr._new(namespaceFilterHandler).arg(setContentHandlerHandler)));
   
    final JMethod setDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setDTDHandler");
    final JVar setDTDHandlerHandler = setDTDHandler.param(DTDHandler.class, "handler");
    setDTDHandler.body().add(xmlReader.invoke("setDTDHandler").arg(setDTDHandlerHandler));
   
View Full Code Here

    final JVar setContentHandlerHandler = setContentHandler.param(ContentHandler.class, "handler");
    setContentHandler.body().add(xmlReader.invoke("setContentHandler").arg(JExpr._new(namespaceFilterHandler).arg(setContentHandlerHandler)));
   
    final JMethod setDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setDTDHandler");
    final JVar setDTDHandlerHandler = setDTDHandler.param(DTDHandler.class, "handler");
    setDTDHandler.body().add(xmlReader.invoke("setDTDHandler").arg(setDTDHandlerHandler));
   
    final JMethod setEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setEntityResolver");
    final JVar setEntityResolverHandler = setEntityResolver.param(EntityResolver.class, "handler");
    setEntityResolver.body().add(xmlReader.invoke("setEntityResolver").arg(setEntityResolverHandler));
   
View Full Code Here

    final JVar setDTDHandlerHandler = setDTDHandler.param(DTDHandler.class, "handler");
    setDTDHandler.body().add(xmlReader.invoke("setDTDHandler").arg(setDTDHandlerHandler));
   
    final JMethod setEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setEntityResolver");
    final JVar setEntityResolverHandler = setEntityResolver.param(EntityResolver.class, "handler");
    setEntityResolver.body().add(xmlReader.invoke("setEntityResolver").arg(setEntityResolverHandler));
   
    final JMethod setErrorHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setErrorHandler");
    final JVar setErrorHandlerHandler = setErrorHandler.param(ErrorHandler.class, "handler");
    setErrorHandler.body().add(xmlReader.invoke("setErrorHandler").arg(setErrorHandlerHandler));
   
View Full Code Here

    final JVar setEntityResolverHandler = setEntityResolver.param(EntityResolver.class, "handler");
    setEntityResolver.body().add(xmlReader.invoke("setEntityResolver").arg(setEntityResolverHandler));
   
    final JMethod setErrorHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setErrorHandler");
    final JVar setErrorHandlerHandler = setErrorHandler.param(ErrorHandler.class, "handler");
    setErrorHandler.body().add(xmlReader.invoke("setErrorHandler").arg(setErrorHandlerHandler));
   
    final JMethod setFeature = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setFeature");
    final JVar setFeatureName = setFeature.param(stringClass, "name");
    final JVar setFeatureValue = setFeature.param(cc.implClass.owner().BOOLEAN, "value");
    setFeature._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
View Full Code Here

      generateSet.javadoc().append(field.type().name());
      generateSet.javadoc().append(".\n<p>Note:\n<p>");
      generateSet.javadoc().append("This method does not make use of the fluent pattern.");
      generateSet.javadoc()
          .append("If you would like to make it fluent, use {@link #with" + Util.upperFirst(field.name()) + "} instead.\n");
      generateSet.body().assign(JExpr._this().ref(field.name()), value);
    }
    // LOG.info("s> " + implClass.name() + " >> public void set" + JaxbUtil.upperFirst(field.name()) + "(" + field.type().name() +
    // ") created [Override: " + override + "].");
  }
View Full Code Here

   
    final JMethod setFeature = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setFeature");
    final JVar setFeatureName = setFeature.param(stringClass, "name");
    final JVar setFeatureValue = setFeature.param(cc.implClass.owner().BOOLEAN, "value");
    setFeature._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
    setFeature.body().add(xmlReader.invoke("setFeature").arg(setFeatureName).arg(setFeatureValue));
   
    final JMethod setProperty = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "setProperty");
    final JVar setPropertyName = setProperty.param(stringClass, "name");
    final JVar setPropertyValue = setProperty.param(Object.class, "value");
    setProperty._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
View Full Code Here

    // add paramter for equals()-method
    final JVar vObj = equalsMethod.param(Object.class, "obj");

    // is it me? this==obj -> true
    final JConditional condMe = equalsMethod.body()._if(JExpr._this().eq(vObj));
    condMe._then()._return(JExpr.TRUE);

    // it's null? obj==null -> false
    final JConditional condNull = equalsMethod.body()._if(vObj.eq(JExpr._null()));
    condNull._then()._return(JExpr.FALSE);
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.