org.modeshape.web.jcr.rest.client.domain
Class NodeType

java.lang.Object
  extended by org.modeshape.web.jcr.rest.client.domain.NodeType
All Implemented Interfaces:
NodeType, NodeTypeDefinition, IModeShapeObject

@Immutable
public class NodeType
extends Object
implements IModeShapeObject, NodeType

The NodeType class is the business object for a ModeShape supported node type.


Nested Class Summary
protected static class NodeType.NodeTypes
           
 
Field Summary
 
Fields inherited from interface javax.jcr.nodetype.NodeType
MIX_CREATED, MIX_LANGUAGE, MIX_LAST_MODIFIED, MIX_LIFECYCLE, MIX_LOCKABLE, MIX_MIMETYPE, MIX_REFERENCEABLE, MIX_SHAREABLE, MIX_SIMPLE_VERSIONABLE, MIX_TITLE, MIX_VERSIONABLE, NT_ACTIVITY, NT_ADDRESS, NT_BASE, NT_CHILD_NODE_DEFINITION, NT_CONFIGURATION, NT_FILE, NT_FOLDER, NT_FROZEN_NODE, NT_HIERARCHY_NODE, NT_LINKED_FILE, NT_NODE_TYPE, NT_PROPERTY_DEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSION_HISTORY, NT_VERSIONED_CHILD
 
Constructor Summary
NodeType(String name, boolean isMixin, boolean isAbstract, List<String> superTypes, List<PropertyDefinition> propertyDefinitions, List<ChildNodeDefinition> childNodeDefinitions, String primaryItemName, boolean hasOrderableChildNodes, boolean isQueryable, Map<String,NodeType> nodeTypes)
          Constructs a new instance.
 
Method Summary
protected  Collection<ChildNodeDefinition> allChildNodeDefinitions()
           
protected  Collection<PropertyDefinition> allPropertyDefinitions()
           
protected  Set<String> allSuperTypeNames()
           
protected  List<NodeType> allSuperTypes()
           
 boolean canAddChildNode(String childNodeName)
           This implementation always returns false.
 boolean canAddChildNode(String childNodeName, String nodeTypeName)
          
 boolean canRemoveItem(String itemName)
           This implementation always returns false.
 boolean canRemoveNode(String nodeName)
           This implementation always returns false.
 boolean canRemoveProperty(String propertyName)
           This implementation always returns false.
 boolean canSetProperty(String propertyName, Value value)
           This implementation always returns false.
 boolean canSetProperty(String propertyName, Value[] values)
           This implementation always returns false.
protected  Collection<ChildNodeDefinition> declaredChildNodeDefinitions()
           
protected  Collection<PropertyDefinition> declaredPropertyDefinitions()
           
 boolean equals(Object obj)
          
 NodeDefinition[] getChildNodeDefinitions()
          
 NodeDefinition[] getDeclaredChildNodeDefinitions()
          
 PropertyDefinition[] getDeclaredPropertyDefinitions()
          
 NodeTypeIterator getDeclaredSubtypes()
          
 String[] getDeclaredSupertypeNames()
          
 NodeType[] getDeclaredSupertypes()
          
 String getName()
          
 String getPrimaryItemName()
          
 PropertyDefinition[] getPropertyDefinitions()
          
 String getShortDescription()
          
 NodeTypeIterator getSubtypes()
          
 NodeType[] getSupertypes()
          
 int hashCode()
          
 boolean hasOrderableChildNodes()
          
 boolean isAbstract()
          
 boolean isMixin()
          
 boolean isNodeType(String nodeTypeName)
          
 boolean isQueryable()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeType

public NodeType(String name,
                boolean isMixin,
                boolean isAbstract,
                List<String> superTypes,
                List<PropertyDefinition> propertyDefinitions,
                List<ChildNodeDefinition> childNodeDefinitions,
                String primaryItemName,
                boolean hasOrderableChildNodes,
                boolean isQueryable,
                Map<String,NodeType> nodeTypes)
Constructs a new instance.

Parameters:
name - the node type name; may not be null
isMixin - true if this node type is a mixin, or false otherwise
isAbstract - true if this node type is an abstract node type, or false otherwise
superTypes - the names of the declared supertypes for this node type; may be null or empty if there are none
propertyDefinitions - the property definitions declared on this node type; may be null or empty if there are none
childNodeDefinitions - the child node definitions declared on this node type; may be null or empty if there are none
primaryItemName - the name of the primary child item; may be null or empty
hasOrderableChildNodes - true if this node type's children are orderable, or false otherwise
isQueryable - true if this node type can be queried, or false otherwise
nodeTypes - the map of node types keyed by their name; may be null only if no node types will be found when needed
Throws:
IllegalArgumentException - if the name is null
Method Detail

getName

public String getName()

Specified by:
getName in interface NodeTypeDefinition
Specified by:
getName in interface IModeShapeObject
Returns:
the object name (never null)
See Also:
IModeShapeObject.getName()

getDeclaredSupertypes

public NodeType[] getDeclaredSupertypes()

Specified by:
getDeclaredSupertypes in interface NodeType
See Also:
NodeType.getDeclaredSupertypes()

getSupertypes

public NodeType[] getSupertypes()

Specified by:
getSupertypes in interface NodeType
See Also:
NodeType.getSupertypes()

getDeclaredSupertypeNames

public String[] getDeclaredSupertypeNames()

Specified by:
getDeclaredSupertypeNames in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.getDeclaredSupertypeNames()

getDeclaredSubtypes

public NodeTypeIterator getDeclaredSubtypes()

Specified by:
getDeclaredSubtypes in interface NodeType
See Also:
NodeType.getDeclaredSubtypes()

getSubtypes

public NodeTypeIterator getSubtypes()

Specified by:
getSubtypes in interface NodeType
See Also:
NodeType.getSubtypes()

allSuperTypes

protected List<NodeType> allSuperTypes()

allSuperTypeNames

protected Set<String> allSuperTypeNames()

getDeclaredChildNodeDefinitions

public NodeDefinition[] getDeclaredChildNodeDefinitions()

Specified by:
getDeclaredChildNodeDefinitions in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.getDeclaredChildNodeDefinitions()

getChildNodeDefinitions

public NodeDefinition[] getChildNodeDefinitions()

Specified by:
getChildNodeDefinitions in interface NodeType
See Also:
NodeType.getChildNodeDefinitions()

declaredChildNodeDefinitions

protected Collection<ChildNodeDefinition> declaredChildNodeDefinitions()

allChildNodeDefinitions

protected Collection<ChildNodeDefinition> allChildNodeDefinitions()

getDeclaredPropertyDefinitions

public PropertyDefinition[] getDeclaredPropertyDefinitions()

Specified by:
getDeclaredPropertyDefinitions in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.getDeclaredPropertyDefinitions()

getPropertyDefinitions

public PropertyDefinition[] getPropertyDefinitions()

Specified by:
getPropertyDefinitions in interface NodeType
See Also:
NodeType.getPropertyDefinitions()

declaredPropertyDefinitions

protected Collection<PropertyDefinition> declaredPropertyDefinitions()

allPropertyDefinitions

protected Collection<PropertyDefinition> allPropertyDefinitions()

getPrimaryItemName

public String getPrimaryItemName()

Specified by:
getPrimaryItemName in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.getPrimaryItemName()

hasOrderableChildNodes

public boolean hasOrderableChildNodes()

Specified by:
hasOrderableChildNodes in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.hasOrderableChildNodes()

isAbstract

public boolean isAbstract()

Specified by:
isAbstract in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.isAbstract()

isMixin

public boolean isMixin()

Specified by:
isMixin in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.isMixin()

isQueryable

public boolean isQueryable()

Specified by:
isQueryable in interface NodeTypeDefinition
See Also:
NodeTypeDefinition.isQueryable()

isNodeType

public boolean isNodeType(String nodeTypeName)

Specified by:
isNodeType in interface NodeType
See Also:
NodeType.isNodeType(java.lang.String)

getShortDescription

public String getShortDescription()

Specified by:
getShortDescription in interface IModeShapeObject
Returns:
a description suitable for use in a tooltip (never null)
See Also:
IModeShapeObject.getShortDescription()

canAddChildNode

public boolean canAddChildNode(String childNodeName)

This implementation always returns false.

Specified by:
canAddChildNode in interface NodeType
See Also:
NodeType.canAddChildNode(java.lang.String)

canAddChildNode

public boolean canAddChildNode(String childNodeName,
                               String nodeTypeName)

Specified by:
canAddChildNode in interface NodeType
See Also:
NodeType.canAddChildNode(java.lang.String, java.lang.String)

canRemoveItem

public boolean canRemoveItem(String itemName)

This implementation always returns false.

Specified by:
canRemoveItem in interface NodeType
See Also:
NodeType.canRemoveItem(java.lang.String)

canRemoveNode

public boolean canRemoveNode(String nodeName)

This implementation always returns false.

Specified by:
canRemoveNode in interface NodeType
See Also:
NodeType.canRemoveNode(java.lang.String)

canRemoveProperty

public boolean canRemoveProperty(String propertyName)

This implementation always returns false.

Specified by:
canRemoveProperty in interface NodeType
See Also:
NodeType.canRemoveProperty(java.lang.String)

canSetProperty

public boolean canSetProperty(String propertyName,
                              Value value)

This implementation always returns false.

Specified by:
canSetProperty in interface NodeType
See Also:
NodeType.canSetProperty(java.lang.String, javax.jcr.Value)

canSetProperty

public boolean canSetProperty(String propertyName,
                              Value[] values)

This implementation always returns false.

Specified by:
canSetProperty in interface NodeType
See Also:
NodeType.canSetProperty(java.lang.String, javax.jcr.Value[])

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.