|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ops4j.pax.reflector.typehandlers.ArrayTypeHandler
public final class ArrayTypeHandler
| Field Summary | |
|---|---|
protected SystemSettings |
m_SystemSettings
|
| Constructor Summary | |
|---|---|
ArrayTypeHandler()
|
|
| Method Summary | |
|---|---|
boolean |
canHandle(java.lang.Object container)
Query if this TypeHandler can deal with the container argument. |
java.lang.Class |
getMemberClass(java.lang.Object container,
java.lang.String membername)
Returns the Class of the member. |
java.lang.String[] |
getMemberNames(java.lang.Object object)
Returns the names of all the accessible members in the container. |
java.lang.Object |
getMemberObject(java.lang.Object container,
java.lang.String membername)
Returns the object that is assigned to the member of the provided container. |
java.lang.String |
getSeparator()
Returns the separator string between container part and the name part. |
SystemSettings |
getSystemSettings()
Returns the System Settings that has been set to the TypeHandler. |
boolean |
isMemberSettable(java.lang.Object container,
java.lang.String membername)
Returns true if the member is settable. |
void |
setMemberObject(java.lang.Object container,
java.lang.String membername,
java.lang.Object value)
Sets the member of a container to the provided value. |
void |
setSystemSettings(SystemSettings settings)
Sets the SystemSettings to this TypeHandler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SystemSettings m_SystemSettings
| Constructor Detail |
|---|
public ArrayTypeHandler()
| Method Detail |
|---|
public SystemSettings getSystemSettings()
getSystemSettings in interface TypeHandlerpublic void setSystemSettings(SystemSettings settings)
setSystemSettings in interface TypeHandlersettings - The SystemSettings currently in use.public boolean canHandle(java.lang.Object container)
container argument.
If this TypeHandler is not able to handle the provided container the ReflectorProvider
implementation must continue to query the lower priority TypeHandlers. It is important that there is
a TypeHandler that can handle "everything else", if this query falls through all the way.
The implementation in this class does;
to determine if the
Class cls = container.getClass();
return cls.isArray();
container can be handled by this TypeHandler.
canHandle in interface TypeHandlercontainer - The container that is being tested.
public java.lang.String[] getMemberNames(java.lang.Object object)
The names returned are in such format that they can be appended to the container, after a getSeparator() string.
This TypeHandler returns a sequence of numbers from 0 to the array size minus 1.
getMemberNames in interface TypeHandlerobject - the container to query for the names.
public java.lang.Object getMemberObject(java.lang.Object container,
java.lang.String membername)
throws ReflectionException
TypeHandler
getMemberObject in interface TypeHandlercontainer - The container that is being queried.membername - The name of the member for which the value is requested.
ReflectionException - if a member with the provided name does not exist, or if
an exception is thrown while accessing the container.
public void setMemberObject(java.lang.Object container,
java.lang.String membername,
java.lang.Object value)
throws ReflectionException
TypeHandler
setMemberObject in interface TypeHandlercontainer - The container that is being queried.membername - The name of the member to have the value set to.value - The value object to be assigned to the member of the container.
ReflectionException - if a member with the provided name does not exist, or if
an exception is thrown while accessing the container.
public java.lang.Class getMemberClass(java.lang.Object container,
java.lang.String membername)
throws ReflectionException
TypeHandlerThe Class return is the type of the field or return type of the member and not the Class of the assigned object to that member.
getMemberClass in interface TypeHandlercontainer - The container that is being queried.membername - The member of the container, for which the Class is to be return.
ReflectionException
public boolean isMemberSettable(java.lang.Object container,
java.lang.String membername)
throws ReflectionException
TypeHandler
isMemberSettable in interface TypeHandlercontainer - The container of interest.membername - The name of the member in the provided container to be checked for if it is settable.
ReflectionExceptionpublic java.lang.String getSeparator()
This implementation returns an empty String.
getSeparator in interface TypeHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||