public class CompiledObject extends Object
.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.| Modifier and Type | Class and Description |
|---|---|
class |
CompiledObject.ChildRef |
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
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 |
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 |
getSimpleType() |
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) |
protected CompiledObject.ChildRef |
newChildRef(CompiledObject child,
String constraints,
String delegateCode) |
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 |
setSimpleType(String simpleType)
Sets the simple type of the object.
|
void |
setStyleClass(String styleClass)
Sets this object's CSS style class.
|
String |
toString() |
public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler)
CompiledObject.
To be useful, the object should be registered with a
JAXXCompiler using
JAXXCompiler.registerCompiledObject(CompiledObject) .id - the object's idobjectClass - the object's classcompiler - the current JAXXCompilerNullPointerException - if id or class is nullpublic CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force)
CompiledObject. To be useful, the object should be registered with a
JAXXCompiler using JAXXCompiler.registerCompiledObject(CompiledObject) .id - the object's idobjectClass - the object's classcompiler - the current JAXXCompilerforce - true to force acceptance of invalid idsNullPointerException - if id or class is nullpublic 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 JAXXCompiler.registerCompiledObject(CompiledObject) .id - the object's idjavaCode - Java code referring to the objectobjectClass - the object's classforce - true to force acceptance of invalid idscompiler - the current JAXXCompilerCompilerException - if the id is not a valid Java identifierNullPointerException - if id or class is nullpublic String getSimpleType()
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 void setSimpleType(String simpleType)
simpleType - the simple type to use (or the fqn if there is a
conflict with already imported types of the compiler).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 containerIllegalArgumentException - 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 getConstructorParams()
setConstructorParams(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 useprotected 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(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 Map<?,?> getProperties()
Map containing all properties defined for this objectaddProperty(String, String)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(EventHandler, JAXXCompiler)public void addChild(CompiledObject child, JAXXCompiler compiler) throws CompilerException
child - the component to addcompiler - the current JAXXCompilerCompilerException - 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 JAXXCompilerCompilerException - if this object is not a containeraddChild(CompiledObject, JAXXCompiler)protected CompiledObject.ChildRef newChildRef(CompiledObject child, String constraints, String delegateCode)
public 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()
Copyright © 2008–2017 Ultreia.io. All rights reserved.