public class JavaTypeDescriptor extends Object implements ITypeDescriptor, org.apache.wicket.model.IDetachable
Constructor and Description |
---|
JavaTypeDescriptor(String name,
String type,
ITypeLocator locator) |
Modifier and Type | Method and Description |
---|---|
void |
addField(IFieldDescriptor field)
Add a field to the type.
|
protected void |
checkMutable() |
void |
detach() |
Map<String,IFieldDescriptor> |
getDeclaredFields()
The map of fields that are declared in this type.
|
IFieldDescriptor |
getField(String key)
Retrieve the field associated with a key.
|
Map<String,IFieldDescriptor> |
getFields()
The map of fields that are declared in this type of any of its super types.
|
String |
getName()
The name of the type.
|
List<ITypeDescriptor> |
getSubTypes()
Retrieve all types that descend from the type.
|
List<String> |
getSuperTypes()
The super types of the type.
|
String |
getType()
The name of the underlying type can be different if this is a "pseudo" type.
|
boolean |
isMixin()
Does the type correspond to a mixin, i.e.
|
boolean |
isMutable() |
boolean |
isNode()
Is the type a compound or mixin type, corresponding to a node type.
|
boolean |
isType(String typeName)
Returns true if this type is
typeName
or a subtype of typeName , otherwise returns
false . |
boolean |
isValidationCascaded()
Returns true if validation is cascaded, i.e.
|
void |
removeField(String name)
Remove a field from the type.
|
void |
setIsMixin(boolean isMixin) |
void |
setIsNode(boolean isNode) |
void |
setIsValidationCascaded(boolean isCascaded) |
void |
setMutable(boolean mutable) |
void |
setObservationContext(IObservationContext context)
Before observation is started on the observable, an observation context is injected by
the observer registry.
|
void |
setPrimary(String name)
Declare one of the fields to be the primary item.
|
void |
setSuperTypes(List<String> superTypes)
Set the super types of the type.
|
void |
startObservation()
When the first
IObserver of this observable is registered with the observer
registry, observation is started. |
void |
stopObservation()
When the last
IObserver unregisters, observation is stopped. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode
public JavaTypeDescriptor(String name, String type, ITypeLocator locator)
public String getName()
ITypeDescriptor
getName
in interface ITypeDescriptor
public String getType()
ITypeDescriptor
For type descriptors that do not correspond to current or draft versions of a namespace, the prefix will be the JCR prefix. (E.g. myproject_0_0 when version 0.1 is current)
getType
in interface ITypeDescriptor
public List<String> getSuperTypes()
ITypeDescriptor
getSuperTypes
in interface ITypeDescriptor
public List<ITypeDescriptor> getSubTypes()
ITypeDescriptor
getSubTypes
in interface ITypeDescriptor
public void setSuperTypes(List<String> superTypes)
ITypeDescriptor
setSuperTypes
in interface ITypeDescriptor
superTypes
- the list of super typespublic Map<String,IFieldDescriptor> getDeclaredFields()
ITypeDescriptor
getDeclaredFields
in interface ITypeDescriptor
public Map<String,IFieldDescriptor> getFields()
ITypeDescriptor
getFields
in interface ITypeDescriptor
public IFieldDescriptor getField(String key)
ITypeDescriptor
getField
in interface ITypeDescriptor
public void addField(IFieldDescriptor field)
ITypeDescriptor
addField
in interface ITypeDescriptor
field
- the field that is added to the typepublic void removeField(String name)
ITypeDescriptor
removeField
in interface ITypeDescriptor
name
- the name of the field that is removedpublic void setPrimary(String name)
ITypeDescriptor
setPrimary
in interface ITypeDescriptor
public boolean isNode()
ITypeDescriptor
isNode
in interface ITypeDescriptor
public void setIsNode(boolean isNode)
setIsNode
in interface ITypeDescriptor
public boolean isMixin()
ITypeDescriptor
isMixin
in interface ITypeDescriptor
public void setIsMixin(boolean isMixin)
setIsMixin
in interface ITypeDescriptor
public boolean isValidationCascaded()
ITypeDescriptor
isValidationCascaded
in interface ITypeDescriptor
public void setIsValidationCascaded(boolean isCascaded)
setIsValidationCascaded
in interface ITypeDescriptor
isCascaded
- are fields of this type always validatedpublic void setObservationContext(IObservationContext context)
IObservable
setObservationContext
in interface IObservable
public void startObservation()
IObservable
IObserver
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.
startObservation
in interface IObservable
public void stopObservation()
IObservable
IObserver
unregisters, observation is stopped. Any listeners
or observers registered by the observable must be unregistered by the implementation.stopObservation
in interface IObservable
public boolean isType(String typeName)
ITypeDescriptor
typeName
or a subtype of typeName
, otherwise returns
false
.isType
in interface ITypeDescriptor
typeName
- the name of a node type.protected void checkMutable()
public boolean isMutable()
public void setMutable(boolean mutable)
public void detach()
detach
in interface org.apache.wicket.model.IDetachable
Copyright © 2007–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.