|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeHandler
TypeHandler interface which allows for extending the special types handling.
A TypeHandler is reponsible for resolving names, retrieval and settings of the members of a container of a particular type.
A TypeHandler implementation is free to obtain the information in any way it wishes, but all default types are using the Java Reflection API to do so, in various ways.
Method Summary | |
---|---|
boolean |
canHandle(Object container)
A query method made by the ReflectorService implementation to determine if this TypeHandler should be used for the provided container. |
Class |
getMemberClass(Object container,
String memberName)
Returns the Class of the member. |
String[] |
getMemberNames(Object container)
Returns the names of all the accessible members in the container. |
Object |
getMemberObject(Object container,
String membername)
Returns the object that is assigned to the member of the provided container. |
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(Object container,
String memberName)
Returns true if the member is settable. |
void |
setMemberObject(Object container,
String membername,
Object value)
Sets the member of a container to the provided value. |
void |
setSystemSettings(SystemSettings settings)
Sets the SystemSettings to this TypeHandler. |
Method Detail |
---|
SystemSettings getSystemSettings()
void setSystemSettings(SystemSettings settings)
settings
- The SystemSettings currently in use.boolean canHandle(Object container)
If the 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.
container
- The container that is being tested.
true
if this TypeHandler is capable of dealing with the provided container,
otherwise false
.String[] getMemberNames(Object container) throws IllegalArgumentException
The names returned are in such format that they can be appended to the container, after a getSeparator() string.
container
- the container to query for the names.
IllegalArgumentException
- If the TypeHandler does not support the container type provided.Object getMemberObject(Object container, String membername) throws ReflectionException
container
- 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.void setMemberObject(Object container, String membername, Object value) throws ReflectionException
container
- 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.Class getMemberClass(Object container, String memberName) throws ReflectionException
The 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.
container
- The container that is being queried.memberName
- The member of the container, for which the Class is to be return.
ReflectionException
boolean isMemberSettable(Object container, String memberName) throws ReflectionException
container
- The container of interest.memberName
- The name of the member in the provided container to be checked for if it is settable.
ReflectionException
String getSeparator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |