|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.compiler.CompiledObject
public class CompiledObject
Represents an object in the .java file being generated during compilation. There is
a CompiledObject for each class tag encountered, and certain tags may generate
additional objects for various reasons.
| Nested Class Summary | |
|---|---|
class |
CompiledObject.ChildRef
|
| Constructor Summary | |
|---|---|
CompiledObject(String id,
ClassDescriptor objectClass,
JAXXCompiler compiler)
Creates a new CompiledObject. |
|
CompiledObject(String id,
ClassDescriptor objectClass,
JAXXCompiler compiler,
boolean force)
Creates a new CompiledObject. |
|
CompiledObject(String id,
String javaCode,
ClassDescriptor objectClass,
JAXXCompiler compiler,
boolean force)
Creates a new CompiledObject. |
|
| Method Summary | |
|---|---|
void |
addChild(CompiledObject child,
JAXXCompiler compiler)
Adds a child component to this container. |
void |
addChild(CompiledObject child,
String constraints,
JAXXCompiler compiler)
Adds a child component to this container. |
void |
addClientProperty(String property,
String value)
|
void |
addEventHandler(String eventId,
MethodDescriptor addMethod,
MethodDescriptor listenerMethod,
String code,
JAXXCompiler compiler)
Adds an event listener to this object. |
void |
addEventHandler(String eventId,
Method addMethod,
Method listenerMethod,
String code,
JAXXCompiler compiler)
|
void |
addProperty(String property,
String value)
Stores a property for this object. |
void |
appendAdditionCode(String code)
Appends code to the addition code block. |
void |
appendInitializationCode(String code)
Appends code to the initialization code block. |
void |
finalizeCompiler(JAXXCompiler compiler)
|
String |
getAdditionCode()
Returns Java code to complete final setup on this object. |
String |
getAdditionMethodName()
Returns the name of the method that should be generated in the compiled .java file in order to add children to this object. |
List<CompiledObject.ChildRef> |
getChilds()
|
Map<String,String> |
getClientProperties()
|
String |
getClientProperty(String key)
|
String |
getConstructorParams()
Returns a list of comma-separated Java code snippets that represent the parameters to pass to this object's constructor. |
String |
getCreationMethodName()
Returns the name of the method that should be generated in the compiled .java file
in order to create this object. |
CompiledObjectDecorator |
getDecorator()
|
String |
getGenericTypes()
|
int |
getGenericTypesLength()
|
String |
getGetterName()
|
String |
getId()
Returns this object's id. |
protected String |
getInitializationCode(EventHandler handler,
JAXXCompiler compiler)
|
String |
getInitializationCode(JAXXCompiler compiler)
Returns the code that performs basic initialization of this object, after it has already been constructed. |
String |
getInitializer()
|
String |
getJavaBeanInitCode()
|
String |
getJavaCode()
Returns Java code used to refer to this object in the compiled Java file. |
String |
getJavaCodeForProperty(String property)
|
ClassDescriptor |
getObjectClass()
Returns the type of this object. |
ClassDescriptor |
getOverrideType()
|
CompiledObject |
getParent()
Returns this object's parent container. |
Map<?,?> |
getProperties()
Returns all properties which have been set for this object. |
String |
getStyleClass()
Returns this object's CSS style class. |
boolean |
hasClientProperties()
|
boolean |
isJavaBean()
|
boolean |
isOverride()
True if this object overrides an object in the superclass of the class being compiled. |
boolean |
isOverrideType()
true when overrides an object in the superclass of the class
being compiled AND type is also override. |
static boolean |
isValidID(String id)
|
void |
setConstructorParams(String constructorParams)
Sets the parameters to pass to this object's constructor. |
void |
setDecorator(CompiledObjectDecorator decorator)
|
void |
setGenericTypes(String[] genericTypes)
|
void |
setInitializer(String initializer)
|
void |
setJavaBean(boolean javaBean)
|
void |
setJavaBeanInitCode(String javaBeanInitCode)
|
void |
setOverride(boolean override)
Sets whether this class overrides an identically-named object in the parent class. |
void |
setOverrideType(ClassDescriptor overrideType)
|
void |
setParent(CompiledObject parent)
Sets this object's parent container. |
void |
setStyleClass(String styleClass)
Sets this object's CSS style class. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompiledObject(String id,
ClassDescriptor objectClass,
JAXXCompiler compiler)
CompiledObject. To be useful, the object should be registered with a
JAXXCompiler using registerCompiledObject.
id - the object's idobjectClass - the object's classcompiler - the current JAXXCompiler
NullPointerException - if id or class is null
public CompiledObject(String id,
ClassDescriptor objectClass,
JAXXCompiler compiler,
boolean force)
CompiledObject. To be useful, the object should be registered with a
JAXXCompiler using registerCompiledObject.
id - the object's idobjectClass - the object's classcompiler - the current JAXXCompilerforce - true to force acceptance of invalid ids
NullPointerException - if id or class is null
public CompiledObject(String id,
String javaCode,
ClassDescriptor objectClass,
JAXXCompiler compiler,
boolean force)
throws CompilerException
CompiledObject. To be useful, the object should be registered with a
JAXXCompiler using registerCompiledObject.
id - the object's idjavaCode - Java code referring to the objectobjectClass - the object's classforce - true to force acceptance of invalid idscompiler - the current JAXXCompiler
CompilerException - if the id is not a valid Java identifier
NullPointerException - if id or class is null| Method Detail |
|---|
public static boolean isValidID(String id)
public boolean isOverride()
JAXXObject which has an
identically-named object.
true if this object is an overridesetOverride(boolean)public boolean isOverrideType()
true when overrides an object in the superclass of the class
being compiled AND type is also override.
true if this object is an override AND override typepublic void setOverride(boolean override)
override - true if this object is an overrideisOverride()public String getStyleClass()
styleClass attributepublic void setStyleClass(String styleClass)
styleClass - the new style classpublic CompiledObject getParent()
null.
public void setParent(CompiledObject parent)
throws IllegalArgumentException
parent - the parent container
IllegalArgumentException - if parent is not a Containerpublic String getCreationMethodName()
.java file
in order to create this object. This is just a suggestion and may be
ignored.
public String getAdditionMethodName()
.java file in order to add children to this object. This
is just a suggestion and may be ignored.
public ClassDescriptor getObjectClass()
CompiledObject representspublic String getId()
.java
file in order to represent this object.
public String getJavaCode()
public String getJavaCodeForProperty(String property)
public String getConstructorParams()
setConstructorParams(java.lang.String)public void setConstructorParams(String constructorParams)
constructorParams - comma-separated Java code snippets representing
constructor paramsgetConstructorParams()public String getInitializer()
public void setInitializer(String initializer)
public String getInitializationCode(JAXXCompiler compiler)
CompiledObjects as they may not have been created yet.
compiler - compiler to use
protected String getInitializationCode(EventHandler handler,
JAXXCompiler compiler)
public String getAdditionCode()
CompiledObjects, as they are guaranteed to
have all been created by this point.
public void appendInitializationCode(String code)
code - the code to add to the initialization blockgetInitializationCode(jaxx.compiler.JAXXCompiler)public void appendAdditionCode(String code)
code - the code to add to the addition blockgetAdditionCode()
public void addProperty(String property,
String value)
getProperties().
property - the name of the propertyvalue - the property's valuegetProperties()public boolean hasClientProperties()
public void addClientProperty(String property,
String value)
public String getClientProperty(String key)
public Map<String,String> getClientProperties()
public Map<?,?> getProperties()
Map containing all properties defined for this objectaddProperty(java.lang.String, java.lang.String)
public void addEventHandler(String eventId,
Method addMethod,
Method listenerMethod,
String code,
JAXXCompiler compiler)
public void addEventHandler(String eventId,
MethodDescriptor addMethod,
MethodDescriptor listenerMethod,
String code,
JAXXCompiler compiler)
eventId - unique (per CompiledObject) identifier for the event handleraddMethod - the method which adds the event listenerlistenerMethod - the method (in the listener class) which is called when the event is firedcode - the Java code for the listenerMethod's bodycompiler - the current JAXXCompilergetInitializationCode(jaxx.compiler.JAXXCompiler)
public void addChild(CompiledObject child,
JAXXCompiler compiler)
throws CompilerException
child - the component to addcompiler - the current JAXXCompiler
CompilerException - if this object is not a containeraddChild(CompiledObject, String, JAXXCompiler)
public void addChild(CompiledObject child,
String constraints,
JAXXCompiler compiler)
throws CompilerException
child - the component to addconstraints - Java code for the layout constraints objectcompiler - the current JAXXCompiler
CompilerException - if this object is not a containeraddChild(CompiledObject, JAXXCompiler)public String toString()
toString in class Objectpublic String getGenericTypes()
public void setGenericTypes(String[] genericTypes)
public boolean isJavaBean()
public void setJavaBean(boolean javaBean)
public ClassDescriptor getOverrideType()
public void setOverrideType(ClassDescriptor overrideType)
public String getJavaBeanInitCode()
public void setJavaBeanInitCode(String javaBeanInitCode)
public List<CompiledObject.ChildRef> getChilds()
public CompiledObjectDecorator getDecorator()
public void setDecorator(CompiledObjectDecorator decorator)
public void finalizeCompiler(JAXXCompiler compiler)
public int getGenericTypesLength()
public String getGetterName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||