Package com.sun.codemodel

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


    final JMethod namespaceFilterXMLReaderclassConstrutor = namespaceFilterXMLReaderclass.constructor(JMod.PUBLIC);
    final JVar paramValidate = namespaceFilterXMLReaderclassConstrutor.param(cc.implClass.owner().BOOLEAN, "validate");
    namespaceFilterXMLReaderclassConstrutor._throws(saxExceptionClass.boxify())._throws(parserConfigurationExceptionClass.boxify());
    final JVar parserFactory = namespaceFilterXMLReaderclassConstrutor.body().decl(saxParserFactoryClass, "parserFactory", saxParserFactoryClass.boxify().staticInvoke("newInstance"));
    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setNamespaceAware").arg(JExpr.TRUE));
    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setValidating").arg(paramValidate));
    namespaceFilterXMLReaderclassConstrutor.body().assign(xmlReader, parserFactory.invoke("newSAXParser").invoke("getXMLReader"));
   
    final JMethod getContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ContentHandler.class, "getContentHandler");
    getContentHandler.body()._return(xmlReader.invoke("getContentHandler"));
   
View Full Code Here


    // cClassInfo
    final String createAndSetCoordinatesName = "createAndSetCoordinates";
    final JMethod m = implClass.method(JMod.PUBLIC, fieldVar.type(), createAndSetCoordinatesName);
    final JVar newValue = m.body().decl(fieldVar.type(), "newValue", JExpr._new(jaxbElementClass));
    final JInvocation methodInvoke = JExpr._this().invoke("set" + Util.upperFirst(fieldVar.name())).arg(newValue);
    m.body().add(methodInvoke);
    m.body()._return(newValue);

    m.javadoc().append("Creates a new instance of ");
    m.javadoc().append(fieldVar.type());
    m.javadoc().append("and set it to this." + fieldVar.name() + ".\n");
View Full Code Here

    final String createAndSetCoordinatesName = "createAndSetCoordinates";
    final JMethod m = implClass.method(JMod.PUBLIC, fieldVar.type(), createAndSetCoordinatesName);
    final JVar newValue = m.body().decl(fieldVar.type(), "newValue", JExpr._new(jaxbElementClass));
    final JInvocation methodInvoke = JExpr._this().invoke("set" + Util.upperFirst(fieldVar.name())).arg(newValue);
    m.body().add(methodInvoke);
    m.body()._return(newValue);

    m.javadoc().append("Creates a new instance of ");
    m.javadoc().append(fieldVar.type());
    m.javadoc().append("and set it to this." + fieldVar.name() + ".\n");
View Full Code Here

    final JVar paramValidate = namespaceFilterXMLReaderclassConstrutor.param(cc.implClass.owner().BOOLEAN, "validate");
    namespaceFilterXMLReaderclassConstrutor._throws(saxExceptionClass.boxify())._throws(parserConfigurationExceptionClass.boxify());
    final JVar parserFactory = namespaceFilterXMLReaderclassConstrutor.body().decl(saxParserFactoryClass, "parserFactory", saxParserFactoryClass.boxify().staticInvoke("newInstance"));
    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setNamespaceAware").arg(JExpr.TRUE));
    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setValidating").arg(paramValidate));
    namespaceFilterXMLReaderclassConstrutor.body().assign(xmlReader, parserFactory.invoke("newSAXParser").invoke("getXMLReader"));
   
    final JMethod getContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ContentHandler.class, "getContentHandler");
    getContentHandler.body()._return(xmlReader.invoke("getContentHandler"));
   
    final JMethod getDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, DTDHandler.class, "getDTDHandler");
View Full Code Here

    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setNamespaceAware").arg(JExpr.TRUE));
    namespaceFilterXMLReaderclassConstrutor.body().add(parserFactory.invoke("setValidating").arg(paramValidate));
    namespaceFilterXMLReaderclassConstrutor.body().assign(xmlReader, parserFactory.invoke("newSAXParser").invoke("getXMLReader"));
   
    final JMethod getContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ContentHandler.class, "getContentHandler");
    getContentHandler.body()._return(xmlReader.invoke("getContentHandler"));
   
    final JMethod getDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, DTDHandler.class, "getDTDHandler");
    getDTDHandler.body()._return(xmlReader.invoke("getDTDHandler"));
   
    final JMethod getEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, EntityResolver.class, "getEntityResolver");
View Full Code Here

   
    final JMethod getContentHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ContentHandler.class, "getContentHandler");
    getContentHandler.body()._return(xmlReader.invoke("getContentHandler"));
   
    final JMethod getDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, DTDHandler.class, "getDTDHandler");
    getDTDHandler.body()._return(xmlReader.invoke("getDTDHandler"));
   
    final JMethod getEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, EntityResolver.class, "getEntityResolver");
    getEntityResolver.body()._return(xmlReader.invoke("getEntityResolver"));
   
    final JMethod getErrorHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ErrorHandler.class, "getErrorHandler");
View Full Code Here

   
    final JMethod getDTDHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, DTDHandler.class, "getDTDHandler");
    getDTDHandler.body()._return(xmlReader.invoke("getDTDHandler"));
   
    final JMethod getEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, EntityResolver.class, "getEntityResolver");
    getEntityResolver.body()._return(xmlReader.invoke("getEntityResolver"));
   
    final JMethod getErrorHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ErrorHandler.class, "getErrorHandler");
    getErrorHandler.body()._return(xmlReader.invoke("getErrorHandler"));
   
    final JMethod getFeature = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().BOOLEAN, "getFeature");
View Full Code Here

   
    final JMethod getEntityResolver = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, EntityResolver.class, "getEntityResolver");
    getEntityResolver.body()._return(xmlReader.invoke("getEntityResolver"));
   
    final JMethod getErrorHandler = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, ErrorHandler.class, "getErrorHandler");
    getErrorHandler.body()._return(xmlReader.invoke("getErrorHandler"));
   
    final JMethod getFeature = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().BOOLEAN, "getFeature");
    final JVar getFeatureName = getFeature.param(stringClass, "name");
    getFeature._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
    getFeature.body()._return(xmlReader.invoke("getFeature").arg(getFeatureName));
View Full Code Here

    getErrorHandler.body()._return(xmlReader.invoke("getErrorHandler"));
   
    final JMethod getFeature = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, cc.implClass.owner().BOOLEAN, "getFeature");
    final JVar getFeatureName = getFeature.param(stringClass, "name");
    getFeature._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
    getFeature.body()._return(xmlReader.invoke("getFeature").arg(getFeatureName));
   
    final JMethod getProperty = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, Object.class, "getProperty");
    final JVar getPropertyName = getProperty.param(stringClass, "name");
    getProperty._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
    getProperty.body()._return(xmlReader.invoke("getProperty").arg(getPropertyName));
View Full Code Here

    getFeature.body()._return(xmlReader.invoke("getFeature").arg(getFeatureName));
   
    final JMethod getProperty = namespaceFilterXMLReaderclass.method(JMod.PUBLIC, Object.class, "getProperty");
    final JVar getPropertyName = getProperty.param(stringClass, "name");
    getProperty._throws(SAXNotRecognizedException.class)._throws(SAXNotSupportedException.class);
    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));
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.