org.ajax4jsf.templatecompiler.builder
Class AbstractCompilationContext

java.lang.Object
  extended by org.ajax4jsf.templatecompiler.builder.AbstractCompilationContext
All Implemented Interfaces:
CompilationContext
Direct Known Subclasses:
AntCompilationContext, RendererCompilationContext

public abstract class AbstractCompilationContext
extends java.lang.Object
implements CompilationContext

Component Beam.

Version:
$Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:42 $
Author:
ayukhovich@exadel.com (latest modification by $Author: alexsmirnov $)

Constructor Summary
AbstractCompilationContext()
           
AbstractCompilationContext(java.lang.ClassLoader loader)
           
 
Method Summary
 void addElementsFactory(ElementsFactory factory)
           
 void addToDeclaration(java.lang.String declaration)
           
 void addToImport(java.lang.String className)
           
 void addVariable(java.lang.String variableName)
          Add variable with type String
 void addVariable(java.lang.String variableName, java.lang.Class<?> clazz)
           
 void addVariable(java.lang.String variableName, java.lang.String typeName)
           
 boolean containsVariable(java.lang.String variableName)
           
 java.lang.String getBaseclassName()
           
 java.lang.String getBaseclassPackageName()
           
 java.lang.ClassLoader getClassLoader()
          return class loader
 java.lang.String getClassName()
           
 java.lang.String getComponentClass()
           
 java.lang.String getComponentFileName()
           
 java.lang.String[] getDeclarations()
           
 java.lang.String[] getEncodeBegin()
           
 java.lang.String[] getEncodeChild()
           
 java.lang.String[] getEncodeEnd()
           
 java.lang.String getFullBaseclass()
           
 java.lang.String getFullClassName()
           
 java.lang.String[] getImports()
           
 java.lang.Class<?> getMethodReturnedClass(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>[] parametersTypes)
           
 java.lang.String getPackageName()
           
 TemplateElement getProcessor(org.w3c.dom.Node nodeElement)
           
 java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class<?> clazz, java.lang.String propertyName)
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.beans.PropertyDescriptor>> getResolvedProperties()
           
 TemplateElement getTree()
           
 java.lang.Class<?> getVariableType(java.lang.String variableName)
           
 java.lang.Class<?> loadClass(java.lang.String className)
           
 java.lang.String processTemplate(java.lang.String name, org.apache.velocity.VelocityContext context)
           
 void setBaseclass(java.lang.String baseclassName)
           
 void setClassName(java.lang.String className)
          set a class name
 void setCode(java.lang.String code)
           
 void setComponentClass(java.lang.String componentClass)
           
 void setDefaultVariables()
           
 void setFullClassName(java.lang.String fullClassName)
           
 void setPackageName(java.lang.String packageName)
          set a package name
 void setTree(TemplateElement tree)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ajax4jsf.templatecompiler.builder.CompilationContext
debug, debug, error, error, getTemplate, info, info, warn, warn
 

Constructor Detail

AbstractCompilationContext

public AbstractCompilationContext()

AbstractCompilationContext

public AbstractCompilationContext(java.lang.ClassLoader loader)
                           throws CompilationException
Parameters:
loader -
Throws:
CompilationException
Method Detail

addElementsFactory

public void addElementsFactory(ElementsFactory factory)

setComponentClass

public void setComponentClass(java.lang.String componentClass)
                       throws CompilationException
Specified by:
setComponentClass in interface CompilationContext
Parameters:
componentClass - The componentClass to set.
Throws:
CompilationException

setPackageName

public void setPackageName(java.lang.String packageName)
set a package name

Specified by:
setPackageName in interface CompilationContext

setClassName

public void setClassName(java.lang.String className)
set a class name

Specified by:
setClassName in interface CompilationContext

setFullClassName

public void setFullClassName(java.lang.String fullClassName)
Specified by:
setFullClassName in interface CompilationContext
Parameters:
fullClassName -

setBaseclass

public void setBaseclass(java.lang.String baseclassName)
                  throws CompilationException
Specified by:
setBaseclass in interface CompilationContext
Throws:
CompilationException

getPackageName

public java.lang.String getPackageName()
Specified by:
getPackageName in interface CompilationContext
Returns:
package name

getBaseclassPackageName

public java.lang.String getBaseclassPackageName()
Specified by:
getBaseclassPackageName in interface CompilationContext
Returns:
base class package name

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface CompilationContext
Returns:
class name

getBaseclassName

public java.lang.String getBaseclassName()
Specified by:
getBaseclassName in interface CompilationContext
Returns:
base class package name

getFullClassName

public java.lang.String getFullClassName()
Specified by:
getFullClassName in interface CompilationContext
Returns:
full class name with package name

getFullBaseclass

public java.lang.String getFullBaseclass()
Specified by:
getFullBaseclass in interface CompilationContext
Returns:
base class package name

getComponentFileName

public java.lang.String getComponentFileName()
Specified by:
getComponentFileName in interface CompilationContext
Returns:

getComponentClass

public java.lang.String getComponentClass()
Specified by:
getComponentClass in interface CompilationContext
Returns:
Returns the componentClass.

getClassLoader

public java.lang.ClassLoader getClassLoader()
return class loader

Specified by:
getClassLoader in interface CompilationContext

getDeclarations

public java.lang.String[] getDeclarations()
Specified by:
getDeclarations in interface CompilationContext
Returns:
string array contain declarations

getImports

public java.lang.String[] getImports()
Specified by:
getImports in interface CompilationContext
Returns:
string array contain declarations

addToImport

public void addToImport(java.lang.String className)
Specified by:
addToImport in interface CompilationContext

addToDeclaration

public void addToDeclaration(java.lang.String declaration)
Specified by:
addToDeclaration in interface CompilationContext

addVariable

public void addVariable(java.lang.String variableName)
                 throws CompilationException
Add variable with type String

Specified by:
addVariable in interface CompilationContext
Parameters:
variableName -
Throws:
CompilationException

addVariable

public void addVariable(java.lang.String variableName,
                        java.lang.Class<?> clazz)
Specified by:
addVariable in interface CompilationContext

addVariable

public void addVariable(java.lang.String variableName,
                        java.lang.String typeName)
                 throws CompilationException
Specified by:
addVariable in interface CompilationContext
Throws:
CompilationException

containsVariable

public boolean containsVariable(java.lang.String variableName)
Specified by:
containsVariable in interface CompilationContext

getVariableType

public java.lang.Class<?> getVariableType(java.lang.String variableName)
Specified by:
getVariableType in interface CompilationContext

loadClass

public java.lang.Class<?> loadClass(java.lang.String className)
                             throws java.lang.ClassNotFoundException
Specified by:
loadClass in interface CompilationContext
Throws:
java.lang.ClassNotFoundException

setDefaultVariables

public void setDefaultVariables()
                         throws CompilationException
Specified by:
setDefaultVariables in interface CompilationContext
Throws:
CompilationException

getMethodReturnedClass

public java.lang.Class<?> getMethodReturnedClass(java.lang.Class<?> clazz,
                                                 java.lang.String methodName,
                                                 java.lang.Class<?>[] parametersTypes)
                                          throws java.lang.NoSuchMethodException
Specified by:
getMethodReturnedClass in interface CompilationContext
Throws:
java.lang.NoSuchMethodException

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class<?> clazz,
                                                           java.lang.String propertyName)
Specified by:
getPropertyDescriptor in interface CompilationContext

getEncodeBegin

public java.lang.String[] getEncodeBegin()
Specified by:
getEncodeBegin in interface CompilationContext
Returns:

getEncodeChild

public java.lang.String[] getEncodeChild()
Specified by:
getEncodeChild in interface CompilationContext
Returns:

getEncodeEnd

public java.lang.String[] getEncodeEnd()
Specified by:
getEncodeEnd in interface CompilationContext
Returns:

setCode

public void setCode(java.lang.String code)
Specified by:
setCode in interface CompilationContext

getTree

public TemplateElement getTree()
Specified by:
getTree in interface CompilationContext
Returns:
the tree

setTree

public void setTree(TemplateElement tree)
Specified by:
setTree in interface CompilationContext
Parameters:
tree - the tree to set

getProcessor

public TemplateElement getProcessor(org.w3c.dom.Node nodeElement)
                             throws CompilationException
Specified by:
getProcessor in interface CompilationContext
Throws:
CompilationException

processTemplate

public java.lang.String processTemplate(java.lang.String name,
                                        org.apache.velocity.VelocityContext context)
                                 throws CompilationException
Specified by:
processTemplate in interface CompilationContext
Throws:
CompilationException

getResolvedProperties

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.beans.PropertyDescriptor>> getResolvedProperties()


Copyright © 2009. All Rights Reserved.