Examples of ClassGenerator


Examples of com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
        _className = getXSLTC().getClassName();

        // Define a new class by extending TRANSLET_CLASS
        final ClassGenerator classGen =
            new ClassGenerator(_className,
                               TRANSLET_CLASS,
                               Constants.EMPTYSTRING,
                               ACC_PUBLIC | ACC_SUPER,
                               null, this);

        addDOMField(classGen);

        // Compile transform() to initialize parameters, globals & output
        // and run the transformation
        compileTransform(classGen);

        // Translate all non-template elements and filter out all templates
        final Enumeration elements = elements();
        while (elements.hasMoreElements()) {
            Object element = elements.nextElement();
            // xsl:template
            if (element instanceof Template) {
                // Separate templates by modes
                final Template template = (Template)element;
                //_templates.addElement(template);
                getMode(template.getModeName()).addTemplate(template);
            }
            // xsl:attribute-set
            else if (element instanceof AttributeSet) {
                ((AttributeSet)element).translate(classGen, null);
            }
            else if (element instanceof Output) {
                // save the element for later to pass to compileConstructor
                Output output = (Output)element;
                if (output.enabled()) _lastOutputElement = output;
            }
            else {
                // Global variables and parameters are handled elsewhere.
                // Other top-level non-template elements are ignored. Literal
                // elements outside of templates will never be output.
            }
        }

        checkOutputMethod();
        processModes();
        compileModes(classGen);
        compileStaticInitializer(classGen);
        compileConstructor(classGen, _lastOutputElement);

        if (!getParser().errorsFound()) {
            getXSLTC().dumpClass(classGen.getJavaClass());
        }
    }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
        _className = getXSLTC().getClassName();

        // Define a new class by extending TRANSLET_CLASS
        final ClassGenerator classGen =
            new ClassGenerator(_className,
                               TRANSLET_CLASS,
                               Constants.EMPTYSTRING,
                               ACC_PUBLIC | ACC_SUPER,
                               null, this);

        addDOMField(classGen);

        // Compile transform() to initialize parameters, globals & output
        // and run the transformation
        compileTransform(classGen);

        // Translate all non-template elements and filter out all templates
        final Enumeration elements = elements();
        while (elements.hasMoreElements()) {
            Object element = elements.nextElement();
            // xsl:template
            if (element instanceof Template) {
                // Separate templates by modes
                final Template template = (Template)element;
                //_templates.addElement(template);
                getMode(template.getModeName()).addTemplate(template);
            }
            // xsl:attribute-set
            else if (element instanceof AttributeSet) {
                ((AttributeSet)element).translate(classGen, null);
            }
            else if (element instanceof Output) {
                // save the element for later to pass to compileConstructor
                Output output = (Output)element;
                if (output.enabled()) _lastOutputElement = output;
            }
            else {
                // Global variables and parameters are handled elsewhere.
                // Other top-level non-template elements are ignored. Literal
                // elements outside of templates will never be output.
            }
        }

        checkOutputMethod();
        processModes();
        compileModes(classGen);
        compileStaticInitializer(classGen);
        compileConstructor(classGen, _lastOutputElement);

        if (!getParser().errorsFound()) {
            getXSLTC().dumpClass(classGen.getJavaClass());
        }
    }
View Full Code Here

Examples of net.sf.cglib.core.ClassGenerator

/*    */     {
/* 31 */       ClassTransformer t = getClassTransformer(name);
/* 32 */       if (t == null)
/* 33 */         return abyte;
/* 34 */       ClassWriter w = new DebuggingClassWriter(true);
/* 35 */       ClassGenerator gen = new ClassReaderGenerator(new ClassReader(abyte), false);
/* 36 */       gen = new TransformingClassGenerator(gen, t);
/* 37 */       gen.generateClass(w);
/* 38 */       return w.toByteArray(); } catch (Exception e) {
/*    */     }
/* 40 */     throw new CodeGenerationException(e);
/*    */   }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    //_templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) _lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  checkOutputMethod();
  processModes();
  compileModes(classGen);
        compileStaticInitializer(classGen);
  compileConstructor(classGen, _lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

    public void translate() {
  Output lastOutputElement = null;
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    _templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  processModes();
  compileModes(classGen);
  compileConstructor(classGen, lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    //_templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) _lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  checkOutputMethod();
  processModes();
  compileModes(classGen);
        compileStaticInitializer(classGen);
  compileConstructor(classGen, _lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    //_templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) _lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  checkOutputMethod();
  processModes();
  compileModes(classGen);
        compileStaticInitializer(classGen);
  compileConstructor(classGen, _lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

    public void translate() {
  Output lastOutputElement = null;
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    _templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  processModes();
  compileModes(classGen);
  compileConstructor(classGen, lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

     */
    public void translate() {
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    //_templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) _lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  checkOutputMethod();
  processModes();
  compileModes(classGen);
        compileStaticInitializer(classGen);
  compileConstructor(classGen, _lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ClassGenerator

    public void translate() {
  Output lastOutputElement = null;
  _className = getXSLTC().getClassName();

  // Define a new class by extending TRANSLET_CLASS
  final ClassGenerator classGen =
      new ClassGenerator(_className,
             TRANSLET_CLASS,
             Constants.EMPTYSTRING,
             ACC_PUBLIC | ACC_SUPER,
             null, this);
 
  addDOMField(classGen);

  // Compile transform() to initialize parameters, globals & output
  // and run the transformation
  compileTransform(classGen);

  // Translate all non-template elements and filter out all templates
  final Enumeration elements = elements();
  while (elements.hasMoreElements()) {
      Object element = elements.nextElement();
      // xsl:template
      if (element instanceof Template) {
    // Separate templates by modes
    final Template template = (Template)element;
    _templates.addElement(template);
    getMode(template.getModeName()).addTemplate(template);
      }
      // xsl:attribute-set
      else if (element instanceof AttributeSet) {
    ((AttributeSet)element).translate(classGen, null);
      }
      else if (element instanceof Output) {
    // save the element for later to pass to compileConstructor
    Output output = (Output)element;
    if (output.enabled()) lastOutputElement = output;
      }
      else {
    // Global variables and parameters are handled elsewhere.
    // Other top-level non-template elements are ignored. Literal
    // elements outside of templates will never be output.
      }
  }

  processModes();
  compileModes(classGen);
  compileConstructor(classGen, lastOutputElement);

  if (!getParser().errorsFound()) {
      getXSLTC().dumpClass(classGen.getJavaClass());
  }
    }
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.