|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.ws.server.ObjectDefinition
public abstract class ObjectDefinition
A base class for all definition classes that require an object to be instantiated. Two options are provided for defining the object:
setClassName(String)
and setArgs(String[])
for declarative definition, orsetDefinedObject(Object)
for programatic definition (or when using dependency injection framework)
If the declarative definition is used, the init()
method must be called after the arguments have been set.
Method Summary | |
---|---|
Object |
getObject()
Returns the defined object (if one has been defined), or otherwise a new instance of the declared class using the declared arguments. |
void |
init()
Method called after configuration is complete. |
void |
setArgs(String[] args)
Set arguments for construction of the specified handler class. |
void |
setClassName(String className)
Set handler class name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final void init() throws WsConfigurationException
setDefinedObject(Object)
), or that the defined class is available with a constructor matching the
defined arguments. Only string arguments are supported for this constructor, and the number of arguments must
match the length of the array passed to setArgs(String[])
.
WsConfigurationException
- if the class is not accessible or is not a handler classpublic final void setClassName(String className)
setDefinedObject(Object)
has not been called. The specified
class must implement either the InHandler
or OutHandler
interface. A new instance of the
specified handler class will be constructed for each service instance. To pass arguments to the construction of
this class call the setArgs(String[])
method.
className
- handler class namepublic final void setArgs(String[] args)
args
- arguments to construct handler withpublic final Object getObject() throws WsConfigurationException
WsConfigurationException
- if a new instance cannot be created
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |