|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xoetrope.registry.ComponentAdapter
public class ComponentAdapter
An adapter of component properties and settings for use with registered components. The class maintains a list of getter and setter methods and helps with invocation of those methods.
Copyright (c) Xoetrope Ltd., 2002-2004
$Revision: 1.18 $
License: see License.txt
Field Summary | |
---|---|
protected java.lang.String |
className
The class name of the class being adapted e.g. com.myorg.MyClass |
protected java.lang.Class |
clazz
The class being adapted |
protected java.util.Hashtable |
getters
The getter methods |
protected java.util.Hashtable |
setters
The setter methods |
protected java.lang.String |
UI
The UI the type of user interface this component supports, e.g. |
Constructor Summary | |
---|---|
ComponentAdapter(java.lang.ClassLoader cl,
java.lang.String clazzName,
java.lang.String ui)
Construct a new adapter for the specified class. |
|
ComponentAdapter(java.lang.Class clazz,
java.lang.String ui)
Construct a new adapter for the specified class. |
|
ComponentAdapter(java.lang.String clazzName,
java.lang.String ui)
Construct a new adapter for the specified class. |
Method Summary | |
---|---|
java.lang.reflect.Method |
addProperty(java.lang.String type,
java.lang.String name,
java.lang.String methodName,
java.lang.String paramType,
boolean attributed,
boolean warn,
XmlElement paramNode)
Try to get and register a method |
java.lang.Class |
getAdapterClass()
Get the class being adapter |
java.lang.String |
getAdapterClassName()
Get the class name of the class being adapter |
java.lang.Object |
getProperty(java.lang.Object comp,
java.lang.String propertyName)
Get a property value. |
java.lang.String |
getUI()
Get the UI type for this component e.g. |
int |
setProperty(java.lang.Object comp,
java.lang.String propertyName,
java.lang.String content,
java.lang.String paramType)
Set a property value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Class clazz
protected java.lang.String UI
protected java.lang.String className
protected java.util.Hashtable setters
protected java.util.Hashtable getters
Constructor Detail |
---|
public ComponentAdapter(java.lang.Class clazz, java.lang.String ui)
clazz
- the class being adapterui
- the type of user interface this component supports, e.g. "swing"
java.lang.ClassNotFoundException
- Could not find the classpublic ComponentAdapter(java.lang.String clazzName, java.lang.String ui) throws java.lang.ClassNotFoundException
clazzName
- the class name e.g. com.myorg.MyClassui
- the type of user interface this component supports, e.g. "swing"
java.lang.ClassNotFoundException
- Could not find the classpublic ComponentAdapter(java.lang.ClassLoader cl, java.lang.String clazzName, java.lang.String ui) throws java.lang.ClassNotFoundException
cl
- the class loader to use to load the classclazzName
- the class name e.g. com.myorg.MyClassui
- the type of user interface this component supports, e.g. "swing"
java.lang.ClassNotFoundException
- Could not find the classMethod Detail |
---|
public java.lang.Class getAdapterClass()
public java.lang.String getAdapterClassName()
public int setProperty(java.lang.Object comp, java.lang.String propertyName, java.lang.String content, java.lang.String paramType)
comp
- the comp whose property is setpropertyName
- the name of the propertyparamType
- the type of parameter (String, int, double, boolean, Object) or null for no parametercontent
- the value to set
public java.lang.Object getProperty(java.lang.Object comp, java.lang.String propertyName)
comp
- the comp whose property is to be retrievedpropertyName
- the name of the property
public java.lang.reflect.Method addProperty(java.lang.String type, java.lang.String name, java.lang.String methodName, java.lang.String paramType, boolean attributed, boolean warn, XmlElement paramNode)
type
- either "get" or "set"name
- the name by which the method is referred to in the page XMLmethodName
- the method nameparamType
- the type of parameter (String, int, double, boolean, Object)attributed
- is the property set via the XAttributedComponent interfacewarn
- true to warn of failure to add the property - the method isparamNode
- the parameters node
called when a page specifies a new property and generally such
properties are set with the setAttribute method. In other cases the
property is being registered so we do want to warn of a failure.
public java.lang.String getUI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |