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 theIFieldDescriptor
interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaFieldDescriptor(String prefix, ITypeDescriptor type)
JavaFieldDescriptor(IFieldDescriptor source)
JavaFieldDescriptor(ITypeDescriptor type, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValidator(String validator)
void
detach()
Set<String>
getExcluded()
For residual field definitions (name is '*'), the excluded names consist of the list of the paths for all other fields in the type.String
getName()
Symbolic name of the field.String
getPath()
The (JCR) path of the field.String
getType()
ITypeDescriptor
getTypeDescriptor()
The descriptor of the type of the field.Set<String>
getValidators()
The symbolic names for validators associated with this field.boolean
isAutoCreated()
Will an instance of the field be created automatically for a new instance of the containing type.boolean
isMandatory()
When the field is mandatory, it must be present for the (JCR) session to be in a valid state.boolean
isMultiple()
Can multiple instances of this field be created.boolean
isOrdered()
When multiple instances of the field can be present, can they be reordered.boolean
isPrimary()
Is this field the primary field of the containing type.boolean
isProtected()
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
setName(String name)
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
setPath(String path)
void
setProtected(boolean protect)
void
startObservation()
When the firstIObserver
of this observable is registered with the observer registry, observation is started.void
stopObservation()
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 Detail
-
JavaFieldDescriptor
public JavaFieldDescriptor(String prefix, ITypeDescriptor type)
-
JavaFieldDescriptor
public JavaFieldDescriptor(ITypeDescriptor type, String path)
-
JavaFieldDescriptor
public JavaFieldDescriptor(IFieldDescriptor source)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IFieldDescriptor
Symbolic name of the field.- Specified by:
getName
in interfaceIFieldDescriptor
- Returns:
- the name
-
setName
public void setName(String name)
-
getType
public String getType()
-
getTypeDescriptor
public ITypeDescriptor getTypeDescriptor()
Description copied from interface:IFieldDescriptor
The descriptor of the type of the field.- Specified by:
getTypeDescriptor
in interfaceIFieldDescriptor
- Returns:
- the type
-
getPath
public String 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
public void setPath(String path)
- 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
public Set<String> 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
public void setExcluded(Set<String> set)
- Specified by:
setExcluded
in interfaceIFieldDescriptor
-
setObservationContext
public void setObservationContext(IObservationContext context)
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
public Set<String> 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
public void addValidator(String validator)
- Specified by:
addValidator
in interfaceIFieldDescriptor
-
removeValidator
public void removeValidator(String validator)
- Specified by:
removeValidator
in interfaceIFieldDescriptor
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
-
-