Package org.hippoecm.frontend.types
Class JavaFieldDescriptor
java.lang.Object
org.hippoecm.frontend.types.JavaFieldDescriptor
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.util.io.IClusterable
,IObservable
,IFieldDescriptor
public class JavaFieldDescriptor
extends Object
implements IFieldDescriptor, org.apache.wicket.model.IDetachable
Bean implementation of the
IFieldDescriptor
interface.- See Also:
-
Constructor Summary
ConstructorDescriptionJavaFieldDescriptor
(String prefix, ITypeDescriptor type) JavaFieldDescriptor
(IFieldDescriptor source) JavaFieldDescriptor
(ITypeDescriptor type, String path) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValidator
(String validator) void
detach()
For residual field definitions (name is '*'), the excluded names consist of the list of the paths for all other fields in the type.getName()
Symbolic name of the field.getPath()
The (JCR) path of the field.getType()
The descriptor of the type of the field.The symbolic names for validators associated with this field.boolean
Will an instance of the field be created automatically for a new instance of the containing type.boolean
When the field is mandatory, it must be present for the (JCR) session to be in a valid state.boolean
Can multiple instances of this field be created.boolean
When multiple instances of the field can be present, can they be reordered.boolean
Is this field the primary field of the containing type.boolean
Is the field protected, i.e.void
removeValidator
(String validator) void
setAutoCreated
(boolean autocreated) void
setExcluded
(Set<String> set) void
setMandatory
(boolean mandatory) void
setMultiple
(boolean multiple) void
void
setObservationContext
(IObservationContext context) Before observation is started on the observable, an observation context is injected by the observer registry.void
setOrdered
(boolean isOrdered) void
void
setProtected
(boolean protect) void
When the firstIObserver
of this observable is registered with the observer registry, observation is started.void
When the lastIObserver
unregisters, observation is stopped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hippoecm.frontend.model.event.IObservable
equals, hashCode
-
Constructor Details
-
JavaFieldDescriptor
-
JavaFieldDescriptor
-
JavaFieldDescriptor
-
-
Method Details
-
getName
Description copied from interface:IFieldDescriptor
Symbolic name of the field.- Specified by:
getName
in interfaceIFieldDescriptor
- Returns:
- the name
-
setName
-
getType
-
getTypeDescriptor
Description copied from interface:IFieldDescriptor
The descriptor of the type of the field.- Specified by:
getTypeDescriptor
in interfaceIFieldDescriptor
- Returns:
- the type
-
getPath
Description copied from interface:IFieldDescriptor
The (JCR) path of the field. This will correspond to the name of the child node or the property.- Specified by:
getPath
in interfaceIFieldDescriptor
- Returns:
- the path
-
setPath
- Specified by:
setPath
in interfaceIFieldDescriptor
-
isMultiple
public boolean isMultiple()Description copied from interface:IFieldDescriptor
Can multiple instances of this field be created.- Specified by:
isMultiple
in interfaceIFieldDescriptor
- Returns:
- true when multiple instances can be created
-
setMultiple
public void setMultiple(boolean multiple) - Specified by:
setMultiple
in interfaceIFieldDescriptor
-
isAutoCreated
public boolean isAutoCreated()Description copied from interface:IFieldDescriptor
Will an instance of the field be created automatically for a new instance of the containing type.- Specified by:
isAutoCreated
in interfaceIFieldDescriptor
- Returns:
- will an instance of the field be created
-
setAutoCreated
public void setAutoCreated(boolean autocreated) - Specified by:
setAutoCreated
in interfaceIFieldDescriptor
-
isProtected
public boolean isProtected()Description copied from interface:IFieldDescriptor
Is the field protected, i.e. can it not be set using the (JCR) api, but is it managed by the system itself.- Specified by:
isProtected
in interfaceIFieldDescriptor
- Returns:
- true when the field is protected
-
setProtected
public void setProtected(boolean protect) -
isMandatory
public boolean isMandatory()Description copied from interface:IFieldDescriptor
When the field is mandatory, it must be present for the (JCR) session to be in a valid state. Note that the use of mandatory fields is discouraged, as the presence of an invalid mandatory field on one node can prevent a wholly different node from being persisted.- Specified by:
isMandatory
in interfaceIFieldDescriptor
- Returns:
- whether the field is mandatory
-
setMandatory
public void setMandatory(boolean mandatory) - Specified by:
setMandatory
in interfaceIFieldDescriptor
-
isOrdered
public boolean isOrdered()Description copied from interface:IFieldDescriptor
When multiple instances of the field can be present, can they be reordered. I.e. do instances behave like a set or a list.- Specified by:
isOrdered
in interfaceIFieldDescriptor
- Returns:
- are instances of the field ordered
-
setOrdered
public void setOrdered(boolean isOrdered) - Specified by:
setOrdered
in interfaceIFieldDescriptor
-
isPrimary
public boolean isPrimary()Description copied from interface:IFieldDescriptor
Is this field the primary field of the containing type. Only one field can be the primary field.- Specified by:
isPrimary
in interfaceIFieldDescriptor
- Returns:
- whether this field is the primary field
-
getExcluded
Description copied from interface:IFieldDescriptor
For residual field definitions (name is '*'), the excluded names consist of the list of the paths for all other fields in the type.- Specified by:
getExcluded
in interfaceIFieldDescriptor
- Returns:
- the excluded names
-
setExcluded
- Specified by:
setExcluded
in interfaceIFieldDescriptor
-
setObservationContext
Description copied from interface:IObservable
Before observation is started on the observable, an observation context is injected by the observer registry. This context can be used to notify listeners.- Specified by:
setObservationContext
in interfaceIObservable
-
startObservation
public void startObservation()Description copied from interface:IObservable
When the firstIObserver
of this observable is registered with the observer registry, observation is started. Implementations must notify observers until observation is stopped.An implementation should register listeners with external data sources, when appropriate. It is possible for an observable to register as an observer for another observable.
- Specified by:
startObservation
in interfaceIObservable
-
stopObservation
public void stopObservation()Description copied from interface:IObservable
When the lastIObserver
unregisters, observation is stopped. Any listeners or observers registered by the observable must be unregistered by the implementation.- Specified by:
stopObservation
in interfaceIObservable
-
getValidators
Description copied from interface:IFieldDescriptor
The symbolic names for validators associated with this field.- Specified by:
getValidators
in interfaceIFieldDescriptor
- Returns:
- the names of applicable validators
-
addValidator
- Specified by:
addValidator
in interfaceIFieldDescriptor
-
removeValidator
- Specified by:
removeValidator
in interfaceIFieldDescriptor
-
detach
public void detach()- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
-