|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.compiler.tags.DefaultObjectHandler
jaxx.compiler.tags.DefaultComponentHandler
public class DefaultComponentHandler
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jaxx.compiler.tags.DefaultObjectHandler |
|---|
DefaultObjectHandler.ProxyEventInfo |
| Field Summary | |
|---|---|
static String |
ACTION_ICON_ATTRIBUTE
|
static String |
CONTAINER_DELEGATE_ATTRIBUTE
|
static String |
FONT_FACE_ATTRIBUTE
|
static String |
FONT_SIZE_ATTRIBUTE
|
static String |
FONT_STYLE_ATTRIBUTE
|
static String |
FONT_WEIGHT_ATTRIBUTE
|
static String |
HEIGHT_ATTRIBUTE
|
static String |
ICON_ATTRIBUTE
|
protected static org.apache.commons.logging.Log |
log
Logger |
static String |
NAME_ATTRIBUTE
|
static String |
WIDTH_ATTRIBUTE
|
static String |
X_ATTRIBUTE
|
static String |
Y_ATTRIBUTE
|
| Fields inherited from interface jaxx.compiler.tags.TagHandler |
|---|
XMLNS_ATTRIBUTE |
| Constructor Summary | |
|---|---|
DefaultComponentHandler(ClassDescriptor beanClass)
|
|
| Method Summary | |
|---|---|
protected void |
closeComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler)
|
void |
compileFirstPass(Element tag,
JAXXCompiler compiler)
Performs the first pass of compilation on an XML tag from a JAXX source file. |
void |
compileSecondPass(Element tag,
JAXXCompiler compiler)
Performs the second pass of compilation on an XML tag from a JAXX source file. |
protected void |
configureProxyEventInfo()
Configures the event handling for members which do not fire PropertyChangeEvent when
modified. |
protected int |
constantValue(String key,
String value)
Maps string values onto integers, so that int-valued enumeration properties can be specified by strings. |
String |
getContainerDelegate()
|
String |
getGetPropertyCode(String id,
String name,
JAXXCompiler compiler)
Returns a snippet of Java code which will retrieve an object property at runtime. |
ClassDescriptor |
getPropertyType(CompiledObject object,
String propertyName,
JAXXCompiler compiler)
Returns the type of the named property. |
String |
getSetPropertyCode(String id,
String name,
String valueCode,
JAXXCompiler compiler)
Returns a snippet of Java code which will set an object property at runtime. |
protected void |
init()
Performs introspection on the beanClass and stores the results. |
boolean |
isContainer()
Returns true if this component can contain other components. |
boolean |
isPropertyInherited(String property)
|
protected void |
openComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler)
|
protected void |
scanAttributesForDependencies(Element tag,
JAXXCompiler compiler)
Scans all attributes for any dependency classes and adds them to the current compilation set. |
void |
setAttribute(CompiledObject object,
String propertyName,
String stringValue,
boolean inline,
JAXXCompiler compiler)
Set a single property on an object. |
protected void |
setDefaults(CompiledObject object,
Element tag,
JAXXCompiler compiler)
Initializes the default settings of the object, prior to setting its attribute values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ACTION_ICON_ATTRIBUTE
public static final String CONTAINER_DELEGATE_ATTRIBUTE
public static final String FONT_FACE_ATTRIBUTE
public static final String FONT_SIZE_ATTRIBUTE
public static final String FONT_STYLE_ATTRIBUTE
public static final String FONT_WEIGHT_ATTRIBUTE
public static final String HEIGHT_ATTRIBUTE
public static final String ICON_ATTRIBUTE
public static final String NAME_ATTRIBUTE
public static final String WIDTH_ATTRIBUTE
public static final String X_ATTRIBUTE
public static final String Y_ATTRIBUTE
protected static final org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public DefaultComponentHandler(ClassDescriptor beanClass)
| Method Detail |
|---|
protected void init()
throws IntrospectionException
DefaultObjectHandler
init in class DefaultObjectHandlerIntrospectionException - if any pbprotected void configureProxyEventInfo()
DefaultObjectHandlerPropertyChangeEvent when
modified. The default implementation does nothing. Subclasses should override this method to call
addProxyEventInfo for each member which requires special handling.
configureProxyEventInfo in class DefaultObjectHandler
protected void setDefaults(CompiledObject object,
Element tag,
JAXXCompiler compiler)
throws CompilerException
DefaultObjectHandler
setDefaults in class DefaultObjectHandlerobject - the object to initializetag - the tag being compiledcompiler - the current JAXXCompiler
CompilerException
public void compileFirstPass(Element tag,
JAXXCompiler compiler)
throws CompilerException,
IOException
TagHandlerTagHandler implementations affect the generated .java
file by calling methods in the JAXXCompiler.
compileFirstPass in interface TagHandlercompileFirstPass in class DefaultObjectHandlertag - the XML tag to compilecompiler - the active JAXXCompiler
CompilerException - if a compilation error occurs
IOException - if an I/O error occurs
public void compileSecondPass(Element tag,
JAXXCompiler compiler)
throws CompilerException,
IOException
TagHandlerTagHandler implementations affect the generated .java
file by calling methods in the JAXXCompiler.
compileSecondPass in interface TagHandlercompileSecondPass in class DefaultObjectHandlertag - the XML tag to compilecompiler - the active JAXXCompiler
CompilerException - if a compilation error occurs
IOException - if an I/O error occurs
protected void openComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler)
throws CompilerException
CompilerException
protected void closeComponent(CompiledObject object,
Element tag,
JAXXCompiler compiler)
throws CompilerException
CompilerException
public boolean isPropertyInherited(String property)
throws UnsupportedAttributeException
isPropertyInherited in class DefaultObjectHandlerproperty - property name to test
true if the specified property should be inherited by child components when specified
via CSS.
UnsupportedAttributeException - if attribute is not supported
public ClassDescriptor getPropertyType(CompiledObject object,
String propertyName,
JAXXCompiler compiler)
throws CompilerException
DefaultObjectHandlerget method;
for instance JLabel's text property is a String.
getPropertyType in class DefaultObjectHandlerobject - the object being compiledpropertyName - the simple JavaBeans-style name of the propertycompiler - the current JAXXCompiler
CompilerException - if the type cannot be determined
public String getGetPropertyCode(String id,
String name,
JAXXCompiler compiler)
throws CompilerException
DefaultObjectHandlerget method, but it can be arbitrarily complex.
getGetPropertyCode in class DefaultObjectHandlerid - Java code for the object whose property is being retrievedname - the name of the property to retrievecompiler - the current JAXXCompiler
CompilerException - if a compilation error occurs
public String getSetPropertyCode(String id,
String name,
String valueCode,
JAXXCompiler compiler)
throws CompilerException
DefaultObjectHandlerset method, but it can be arbitrarily complex.
getSetPropertyCode in class DefaultObjectHandlerid - Java code for the object whose property is being setname - the name of the property to setvalueCode - Java expression representing the value to set the property tocompiler - the current JAXXCompiler
CompilerException - if a compilation error occurs
public void setAttribute(CompiledObject object,
String propertyName,
String stringValue,
boolean inline,
JAXXCompiler compiler)
DefaultObjectHandlerDefaultObjectHandler.convertFromString(java.lang.String, java.lang.String, java.lang.Class>).
setAttribute in class DefaultObjectHandlerobject - the object on which to set the propertypropertyName - the name of the property to setstringValue - the raw string value of the property from the XMLinline - true if the value was directly specified as an inline class tag attribute, false otherwise (a default value, specified in CSS, etc.)compiler - the current JAXXCompiler
protected void scanAttributesForDependencies(Element tag,
JAXXCompiler compiler)
DefaultObjectHandlercompileFirstPass() (it is an error to add dependencies after
pass 1 is complete).
scanAttributesForDependencies in class DefaultObjectHandlertag - tag to scancompiler - compiler to use
protected int constantValue(String key,
String value)
DefaultObjectHandler.convertFromString(java.lang.String, java.lang.String, java.lang.Class>) when an
int-valued property has a value which is not a valid number. By default, this method looks at the
enumerationValues value of the JAXXPropertyDescriptor.
constantValue in class DefaultObjectHandlerkey - the name of the int-typed propertyvalue - the non-numeric value that was specified for the property
IllegalArgumentException - if the property is an enumeration, but the value is not valid
NumberFormatException - if the property is not an enumerationpublic boolean isContainer()
true if this component can contain other components. For children to be
allowed, the component must be a subclass of Container and its JAXXBeanInfo
must not have the value false for its isContainer value.
true if children are allowedpublic String getContainerDelegate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||