|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.registry.ComponentAdapter
org.formaria.registry.ReflectionAdapter
public class ReflectionAdapter
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, if a getter or setter is not available then reflection is used to try and find an appropriate method.
Copyright (c) Formaria Ltd., 2008
License: see License.txt
| Field Summary |
|---|
| Fields inherited from class org.formaria.registry.ComponentAdapter |
|---|
className, clazz, getters, setters, UI |
| Constructor Summary | |
|---|---|
ReflectionAdapter(java.lang.ClassLoader cl,
java.lang.String clazzName,
java.lang.String ui)
Construct a new adapter for the specified class. |
|
ReflectionAdapter(java.lang.Class clazz,
java.lang.String ui)
Construct a new adapter for the specified class. |
|
ReflectionAdapter(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 propertyName)
Try to get and register a method |
java.lang.Object |
getProperty(java.lang.Object comp,
java.lang.String propertyName)
Get a property value. |
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 org.formaria.registry.ComponentAdapter |
|---|
addProperty, getAdapterClass, getAdapterClassName, getUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectionAdapter(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 class
public ReflectionAdapter(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 class
public ReflectionAdapter(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 class| Method Detail |
|---|
public int setProperty(java.lang.Object comp,
java.lang.String propertyName,
java.lang.String content,
java.lang.String paramType)
setProperty in class ComponentAdaptercomp - 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)
getProperty in class ComponentAdaptercomp - 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 propertyName)
type - either "get" or "set"propertyName - the method name
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||