org.objectweb.jonathan.libs.kernel.decoders
Class LazyComponent
java.lang.Object
org.objectweb.jonathan.libs.kernel.JComponent
org.objectweb.jonathan.libs.kernel.decoders.LazyComponent
- All Implemented Interfaces:
- Component, Forkable
- Direct Known Subclasses:
- JAssemblage, JAtom, JSequence
public abstract class LazyComponent
- extends JComponent
Lazy implementation of a runtime component. Its
initialization (configuration resolution & instanciation)
is called before each access to its type & value fields.
Method Summary |
int |
getIntValue()
Returns the value of the target component, if its class is an integer class. |
java.lang.Class |
getType()
Returns the type of the target component, as a Class. |
java.lang.Object |
getValue()
Returns the value of the target component, if its type is an object reference
type. |
protected abstract void |
initialize()
|
Methods inherited from class org.objectweb.jonathan.libs.kernel.JComponent |
duplicate, fork, getComponent, getElement, getFactoryValue, getReference, getValue, internalFork, reset, setReference, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
initialized
protected boolean initialized
LazyComponent
public LazyComponent()
getType
public java.lang.Class getType()
- Description copied from interface:
Component
- Returns the type of the target component, as a Class.
- Specified by:
getType
in interface Component
- Overrides:
getType
in class JComponent
- Returns:
- the type of the target component, as a Class.
getValue
public java.lang.Object getValue()
- Description copied from interface:
Component
- Returns the value of the target component, if its type is an object reference
type.
If the target component is of an integral type,
NO_VALUE
} is returned.
- Specified by:
getValue
in interface Component
- Overrides:
getValue
in class JComponent
- Returns:
- the value of the target component.
getIntValue
public int getIntValue()
- Description copied from interface:
Component
- Returns the value of the target component, if its class is an integer class.
If the target component has an object reference type, Integer.MAX_VALUE is
returned.
- Specified by:
getIntValue
in interface Component
- Overrides:
getIntValue
in class JComponent
- Returns:
- the value of the target component.
initialize
protected abstract void initialize()