| java.lang.Object jaxx.compiler.CompiledObject
All known Subclasses: jaxx.tags.swing.CompiledItemContainer, jaxx.compiler.ScriptInitializer,
CompiledObject | public class CompiledObject (Code) | | 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.
|
Method Summary | |
public void | addChild(CompiledObject child, JAXXCompiler compiler) Adds a child component to this container. | public void | addChild(CompiledObject child, String constraints, JAXXCompiler compiler) Adds a child component to this container. | 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) Adds an event listener to this object. | public void | addProperty(String property, String value) Stores a property for this object. | public void | appendAdditionCode(String code) Appends code to the addition code block. | public void | appendInitializationCode(String code) Appends code to the initialization code block. | public String | getAdditionCode() Returns Java code to complete final setup on this object. | public 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. | public String | getConstructorParams() Returns a list of comma-separated Java code snippets that represent the parameters to pass to this
object's constructor. | public String | getCreationMethodName() Returns the name of the method that should be generated in the compiled .java file
in order to create this object. | public String | getId() Returns this object's id. | public String | getInitializationCode(JAXXCompiler compiler) Returns the code that performs basic initialization of this object, after it has already been constructed. | protected String | getInitializationCode(EventHandler handler, JAXXCompiler compiler) | public String | getJavaCode() Returns Java code used to refer to this object in the compiled Java file. | public ClassDescriptor | getObjectClass() Returns the type of this object. | public CompiledObject | getParent() Returns this object's parent container. | public Map | getProperties() Returns all properties which have been set for this object. | public String | getStyleClass() Returns this object's CSS style class. | public boolean | isOverride() True if this object overrides an object in the superclass of the class being compiled. | public static boolean | isValidID(String id) | public void | registerDataBinding(String src, String property, String assignment, JAXXCompiler compiler) | public void | setConstructorParams(String constructorParams) Sets the parameters to pass to this object's constructor. | public void | setOverride(boolean override) Sets whether this class overrides an identically-named object in the parent class. | public void | setParent(CompiledObject parent) Sets this object's parent container. | public void | setStyleClass(String styleClass) Sets this object's CSS style class. | public String | toString() |
CompiledObject | public CompiledObject(String id, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force)(Code) | | Creates a new CompiledObject . To be useful, the object should be registered with a
JAXXCompiler using
JAXXCompiler.registerCompiledObject registerCompiledObject .
Parameters: id - the object's id Parameters: objectClass - the object's class Parameters: compiler - the current JAXXCompiler Parameters: force - true to force acceptance of invalid ids throws: NullPointerException - if id or class is null |
CompiledObject | public CompiledObject(String id, String javaCode, ClassDescriptor objectClass, JAXXCompiler compiler, boolean force) throws CompilerException(Code) | | Creates a new CompiledObject . To be useful, the object should be registered with a
JAXXCompiler using
JAXXCompiler.registerCompiledObject registerCompiledObject .
Parameters: id - the object's id Parameters: javaCode - Java code referring to the object Parameters: objectClass - the object's class Parameters: force - true to force acceptance of invalid ids Parameters: compiler - the current JAXXCompiler throws: CompilerException - if the id is not a valid Java identifier throws: NullPointerException - if id or class is null |
addEventHandler | public void addEventHandler(String eventId, MethodDescriptor addMethod, MethodDescriptor listenerMethod, String code, JAXXCompiler compiler)(Code) | | Adds an event listener to this object. The generated code will appear in the initialization block.
Parameters: eventId - unique (per CompiledObject) identifier for the event handler Parameters: addMethod - the method which adds the event listener Parameters: listenerMethod - the method (in the listener class) which is called when the event is fired Parameters: code - the Java code for the listenerMethod's body Parameters: compiler - the current JAXXCompiler See Also: CompiledObject.getInitializationCode |
addProperty | public void addProperty(String property, String value)(Code) | | Stores a property for this object. The only effect of calling this method is that the property will
be returned by getProperties() .
Parameters: property - the name of the property Parameters: value - the property's value See Also: CompiledObject.getProperties |
appendAdditionCode | public void appendAdditionCode(String code)(Code) | | Appends code to the addition code block. A line separator is automatically appended to the end.
Parameters: code - the code to add to the addition block See Also: CompiledObject.getAdditionCode |
appendInitializationCode | public void appendInitializationCode(String code)(Code) | | Appends code to the initialization code block. A line separator is automatically appended to the end.
Parameters: code - the code to add to the initialization block See Also: CompiledObject.getInitializationCode |
getAdditionCode | public String getAdditionCode()(Code) | | Returns Java code to complete final setup on this object. This code may reference other
CompiledObjects , as they are guaranteed to have all been created by this point.
code which adds children and performs final setup |
getAdditionMethodName | public String getAdditionMethodName()(Code) | | Returns the name of the method that should be generated in the compiled .java file
in order to add children to this object. This is just a suggestion and may be ignored.
the suggested name of the method which completes this object's setup |
getConstructorParams | public String getConstructorParams()(Code) | | Returns a list of comma-separated Java code snippets that represent the parameters to pass to this
object's constructor.
the raw constructor params See Also: CompiledObject.setConstructorParams |
getCreationMethodName | public String getCreationMethodName()(Code) | | Returns the name of the method that should be generated in the compiled .java file
in order to create this object. This is just a suggestion and may be ignored.
the suggested name of the method which initializes this object |
getId | public String getId()(Code) | | Returns this object's id. Generally, a field with this name will be created in the compiled .java
file in order to represent this object.
the id used to refer to this object |
getInitializationCode | public String getInitializationCode(JAXXCompiler compiler)(Code) | | Returns the code that performs basic initialization of this object, after it has already been constructed.
This basic code should not reference any other CompiledObjects as they may not have
been created yet.
the code which initializes this object |
getJavaCode | public String getJavaCode()(Code) | | Returns Java code used to refer to this object in the compiled Java file. This is usually the same as its
id.
the Java code for this object |
getObjectClass | public ClassDescriptor getObjectClass()(Code) | | Returns the type of this object.
the class this CompiledObject represents |
getParent | public CompiledObject getParent()(Code) | | Returns this object's parent container. Non-visual components (and the root container) return null .
the object's parent container |
getProperties | public Map getProperties()(Code) | | Returns all properties which have been set for this object.
a Map containing all properties defined for this object See Also: CompiledObject.addProperty |
getStyleClass | public String getStyleClass()(Code) | | Returns this object's CSS style class.
the value of the styleClass attribute |
isOverride | public boolean isOverride()(Code) | | True if this object overrides an object in the superclass of the class being compiled. For this to be true, the
class currently being compiled must be a subclass of another JAXXObject which has an
identically-named object.
true if this object is an override See Also: CompiledObject.setOverride |
setConstructorParams | public void setConstructorParams(String constructorParams)(Code) | | Sets the parameters to pass to this object's constructor.
Parameters: constructorParams - comma-separated Java code snippets representing constructor params See Also: CompiledObject.getConstructorParams |
setOverride | public void setOverride(boolean override)(Code) | | Sets whether this class overrides an identically-named object in the parent class.
Parameters: override - true if this object is an override See Also: CompiledObject.isOverride |
setParent | public void setParent(CompiledObject parent)(Code) | | Sets this object's parent container.
Parameters: parent - the parent container |
setStyleClass | public void setStyleClass(String styleClass)(Code) | | Sets this object's CSS style class.
Parameters: styleClass - the new style class |
|
|