Package com.ponysdk.generator

Examples of com.ponysdk.generator.ClassWriter.addLine()


    public void generate() throws Exception {
        final ClassWriter classWriter = new ClassWriter(this, getSrcGeneratedDirectory(), getPackageName(), "ProxyBuilder");
        classWriter.addImplements(ApplicationContextAware.class);
        classWriter.addNewLine();
        classWriter.addLine("private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(ProxyBuilder.class);");

        classWriter.addLine("@Override");
        classWriter.addLine("public void setApplicationContext(" + ApplicationContext.class.getCanonicalName() + " context) throws " + BeansException.class.getCanonicalName() + " {");
        classWriter.addNewLine();
View Full Code Here


        final ClassWriter classWriter = new ClassWriter(this, getSrcGeneratedDirectory(), getPackageName(), "ProxyBuilder");
        classWriter.addImplements(ApplicationContextAware.class);
        classWriter.addNewLine();
        classWriter.addLine("private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(ProxyBuilder.class);");

        classWriter.addLine("@Override");
        classWriter.addLine("public void setApplicationContext(" + ApplicationContext.class.getCanonicalName() + " context) throws " + BeansException.class.getCanonicalName() + " {");
        classWriter.addNewLine();

        for (final Root root : domains) {
            this.domain = root.getDomain();
View Full Code Here

        classWriter.addImplements(ApplicationContextAware.class);
        classWriter.addNewLine();
        classWriter.addLine("private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(ProxyBuilder.class);");

        classWriter.addLine("@Override");
        classWriter.addLine("public void setApplicationContext(" + ApplicationContext.class.getCanonicalName() + " context) throws " + BeansException.class.getCanonicalName() + " {");
        classWriter.addNewLine();

        for (final Root root : domains) {
            this.domain = root.getDomain();
            classWriter.addLine("try{");
View Full Code Here

        classWriter.addLine("public void setApplicationContext(" + ApplicationContext.class.getCanonicalName() + " context) throws " + BeansException.class.getCanonicalName() + " {");
        classWriter.addNewLine();

        for (final Root root : domains) {
            this.domain = root.getDomain();
            classWriter.addLine("try{");
            classWriter.indentBlock();
            classWriter.addLine("com.ponysdk.core.service.PonyServiceRegistry.registerPonyService(context.getBean(" + GeneratorHelper.getServiceFullClassName(domain) + ".class));");
            classWriter.unindentBlock();
            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
View Full Code Here

        for (final Root root : domains) {
            this.domain = root.getDomain();
            classWriter.addLine("try{");
            classWriter.indentBlock();
            classWriter.addLine("com.ponysdk.core.service.PonyServiceRegistry.registerPonyService(context.getBean(" + GeneratorHelper.getServiceFullClassName(domain) + ".class));");
            classWriter.unindentBlock();
            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
View Full Code Here

            this.domain = root.getDomain();
            classWriter.addLine("try{");
            classWriter.indentBlock();
            classWriter.addLine("com.ponysdk.core.service.PonyServiceRegistry.registerPonyService(context.getBean(" + GeneratorHelper.getServiceFullClassName(domain) + ".class));");
            classWriter.unindentBlock();
            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
            classWriter.addLine("}");
            classWriter.addLine("catch(Exception e){");
View Full Code Here

            classWriter.indentBlock();
            classWriter.addLine("com.ponysdk.core.service.PonyServiceRegistry.registerPonyService(context.getBean(" + GeneratorHelper.getServiceFullClassName(domain) + ".class));");
            classWriter.unindentBlock();
            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
            classWriter.addLine("}");
            classWriter.addLine("catch(Exception e){");
            classWriter.indentBlock();
            classWriter.addLine("String errorMessage = \"Error when starting service " + domain.getName() + "\";");
View Full Code Here

            classWriter.unindentBlock();
            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
            classWriter.addLine("}");
            classWriter.addLine("catch(Exception e){");
            classWriter.indentBlock();
            classWriter.addLine("String errorMessage = \"Error when starting service " + domain.getName() + "\";");
            classWriter.addLine("log.error(errorMessage, e);");
            classWriter.addLine("throw new " + RuntimeException.class.getCanonicalName() + "(errorMessage, e);");
View Full Code Here

            classWriter.addLine("}catch(org.springframework.beans.factory.NoSuchBeanDefinitionException e){");
            classWriter.indentBlock();
            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
            classWriter.addLine("}");
            classWriter.addLine("catch(Exception e){");
            classWriter.indentBlock();
            classWriter.addLine("String errorMessage = \"Error when starting service " + domain.getName() + "\";");
            classWriter.addLine("log.error(errorMessage, e);");
            classWriter.addLine("throw new " + RuntimeException.class.getCanonicalName() + "(errorMessage, e);");
View Full Code Here

            classWriter.addLine("log.warn(\"No service defined for " + domain.getName() + "\");");
            classWriter.unindentBlock();
            classWriter.addLine("}");
            classWriter.addLine("catch(Exception e){");
            classWriter.indentBlock();
            classWriter.addLine("String errorMessage = \"Error when starting service " + domain.getName() + "\";");
            classWriter.addLine("log.error(errorMessage, e);");
            classWriter.addLine("throw new " + RuntimeException.class.getCanonicalName() + "(errorMessage, e);");

            classWriter.unindentBlock();
            classWriter.addLine("}");
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.