|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.dna.jcr.PropertyDefinitionId
@Immutable public final class PropertyDefinitionId

An immutable identifier for a property definition. Although instances can be serialized, the property 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 :
"A node type may have two or more property definitions with identical name attributes (the value returned by
ItemDefinition.getName) as long as the definitions are otherwise distinguishable by either the required type attribute (the
value returned by PropertyDefinition.getRequiredType) or the multiple attribute (the value returned by
PropertyDefinition.isMultiple)."
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 | |
|---|---|
PropertyDefinitionId(Name nodeTypeName,
Name propertyDefinitionName,
int propertyType,
boolean allowsMultiple)
Create a new identifier for a property definition. |
|
| Method Summary | |
|---|---|
boolean |
allowsAnyChildName()
Determine whether this property definition allows properties with any name. |
boolean |
allowsMultiple()
Return whether the property definition allows multiple values. |
PropertyDefinitionId |
asMultiValued()
|
PropertyDefinitionId |
asSingleValued()
|
boolean |
equals(Object obj)
|
static PropertyDefinitionId |
fromString(String definition,
NameFactory factory)
Parse the supplied string for of an identifer, and return the object form for that identifier. |
Name |
getNodeTypeName()
Get the name of the node type on which the property definition is defined |
Name |
getPropertyDefinitionName()
Get the name of the property definition. |
int |
getPropertyType()
Get the required property type |
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 PropertyDefinitionId(Name nodeTypeName,
Name propertyDefinitionName,
int propertyType,
boolean allowsMultiple)
nodeTypeName - the name of the node type; may not be nullpropertyDefinitionName - the name of the property definition, which may be a residual property; may
not be nullpropertyType - the required property type for the definition; must be a valid PropertyType valueallowsMultiple - true if the property definition should allow multiple values, or false if it is a single-value
property definition| Method Detail |
|---|
public Name getNodeTypeName()
public Name getPropertyDefinitionName()
public int getPropertyType()
PropertyType valuepublic boolean allowsMultiple()
public boolean allowsAnyChildName()
public String getString()
public static PropertyDefinitionId 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 PropertyDefinitionId asSingleValued()
public PropertyDefinitionId asMultiValued()
public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||