|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.jcr.NodeDefinitionId
@Immutable public final class NodeDefinitionId
An immutable identifier for a node definition. Although instances can be serialized, the node definitions are often stored
within the graph as string values
on a property. These string values can later be
parsed
to reconstruct the identifier. Note that this string representation does not
use namespace prefixes, so they are long-lasting and durable.
What distinguishes one property definition from another is not well documented in the JSR-170 specification. The closest this version of the spec gets is Section 6.7.15, but that merely says that more than one property definition can have the same name. The proposed draft of the JSR-283 specification does clarify this more: Section 4.7.15 says :
"Similarly, a node type may have two or more child node definitions with identical name attributes as long as they are
distinguishable by the required primary types attribute (the value returned by
NodeDefinition.getRequiredPrimaryTypes)."
This class is Serializable
and designed to be used as a key in a HashMap
.
Field Summary | |
---|---|
static String |
ANY_NAME
The string-form of the name that can be used to represent a residual property definition. |
Constructor Summary | |
---|---|
NodeDefinitionId(Name nodeTypeName,
Name childDefinitionName,
Name[] requiredPrimaryTypes)
Create an identifier for a node definition. |
Method Summary | |
---|---|
boolean |
allowsAnyChildName()
Determine whether this node definition defines any named child. |
boolean |
equals(Object obj)
|
static NodeDefinitionId |
fromString(String definition,
NameFactory factory)
Parse the supplied string for of an identifer, and return the object form for that identifier. |
Name |
getChildDefinitionName()
Get the name of the child definition. |
Name |
getNodeTypeName()
Get the name of the node type on which the child node definition is defined. |
Name[] |
getRequiredPrimaryTypes()
|
String |
getString()
Get the string form of this identifier. |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ANY_NAME
Constructor Detail |
---|
public NodeDefinitionId(Name nodeTypeName, Name childDefinitionName, Name[] requiredPrimaryTypes)
nodeTypeName
- the name of the node type on which this child node definition is defined; may not be nullchildDefinitionName
- the name of the child node definition, which may be a residual child
definition
; may not be nullrequiredPrimaryTypes
- the names of the required primary types for the child node definitionMethod Detail |
---|
public Name getNodeTypeName()
public Name getChildDefinitionName()
public Name[] getRequiredPrimaryTypes()
public boolean allowsAnyChildName()
public String getString()
public static NodeDefinitionId fromString(String definition, NameFactory factory)
definition
- the string form of the identifier
; may not be nullfactory
- the factory that should be used to create Name objects; may not be null
ValueFormatException
- if the definition is not the valid formatpublic int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |