public class NodeTypeUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ANY_PROPERTY_TYPE |
Constructor and Description |
---|
NodeTypeUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getIllegalChildNodeType(javax.jcr.nodetype.NodeTypeManager manager,
String legalType)
Returns a node type that is nor legalType nor a sub type of of
|
static String |
getUndefinedChildNodeName(javax.jcr.nodetype.NodeType nodeType)
Returns a name that is not defined by the nodeType's child node def
|
static javax.jcr.Value |
getValueAccordingToValueConstraints(javax.jcr.Session session,
javax.jcr.nodetype.PropertyDefinition propDef,
boolean satisfied)
Returns a value according to the value contraints of a
PropertyDefinition |
static javax.jcr.Value |
getValueOfType(javax.jcr.Session session,
int type)
Returns any value of the requested type
|
static List<javax.jcr.nodetype.NodeDefinition> |
locateAllChildNodeDef(javax.jcr.Session session,
boolean regardDefaultPrimaryType,
boolean defaultPrimaryType,
boolean residual)
Locate all non-protected child node def declared by a non-abstract node type
parsing all node types
|
static javax.jcr.nodetype.NodeDefinition |
locateChildNodeDef(javax.jcr.Session session,
boolean isProtected,
boolean mandatory)
Locate a child node def parsing all node types
|
static javax.jcr.nodetype.NodeDefinition |
locateChildNodeDef(javax.jcr.Session session,
boolean regardDefaultPrimaryType,
boolean defaultPrimaryType,
boolean residual)
Locate a non-protected child node def declared by a non-abstract node type
parsing all node types
|
static javax.jcr.nodetype.PropertyDefinition |
locatePropertyDef(javax.jcr.Session session,
boolean isProtected,
boolean mandatory)
Locate a property def parsing all node types
|
static javax.jcr.nodetype.PropertyDefinition |
locatePropertyDef(javax.jcr.Session session,
int propertyType,
boolean multiple,
boolean isProtected,
boolean constraints,
boolean residual)
Locate a property def parsing all node types
|
public static final int ANY_PROPERTY_TYPE
public static javax.jcr.nodetype.NodeDefinition locateChildNodeDef(javax.jcr.Session session, boolean regardDefaultPrimaryType, boolean defaultPrimaryType, boolean residual) throws javax.jcr.RepositoryException
session
- the session to access the node typesregardDefaultPrimaryType
- if true, the default primary type of the
returned NodeDef
is
according to param defaultPrimaryType
.
If false, the returned NodeDef
might have a default primary type or
not.defaultPrimaryType
- if regardDefaultPrimaryType
is true: if true, the returned
NodeDef
has a default
primary type, else notresidual
- if true, the returned NodeDef
is of the residual name "*", else notjavax.jcr.RepositoryException
public static List<javax.jcr.nodetype.NodeDefinition> locateAllChildNodeDef(javax.jcr.Session session, boolean regardDefaultPrimaryType, boolean defaultPrimaryType, boolean residual) throws javax.jcr.RepositoryException
session
- the session to access the node typesregardDefaultPrimaryType
- if true, the default primary type of the
returned NodeDef
is
according to param defaultPrimaryType
.
If false, the returned NodeDef
might have a default primary type or
not.defaultPrimaryType
- if regardDefaultPrimaryType
is true: if true, the returned
NodeDef
has a default
primary type, else notresidual
- if true, the returned NodeDef
is of the residual name "*", else notjavax.jcr.RepositoryException
public static javax.jcr.nodetype.NodeDefinition locateChildNodeDef(javax.jcr.Session session, boolean isProtected, boolean mandatory) throws javax.jcr.RepositoryException
session
- the session to access the node typesisProtected
- if true, the returned NodeDef
is
protected, else notmandatory
- if true, the returned NodeDef
is
mandatory, else notNodeDef
found fitting the requirementsjavax.jcr.RepositoryException
public static javax.jcr.nodetype.PropertyDefinition locatePropertyDef(javax.jcr.Session session, int propertyType, boolean multiple, boolean isProtected, boolean constraints, boolean residual) throws javax.jcr.RepositoryException
session
- the session to access the node typespropertyType
- the type of the returned property. -1 indicates to
return a property of any type but not UNDEFIENDmultiple
- if true, the returned PropertyDef
is
multiple, else notisProtected
- if true, the returned PropertyDef
is
protected, else notresidual
- if true, the returned PropertyDef
is of
the residual name "*", else notPropertyDef
found fitting the
requirementsjavax.jcr.RepositoryException
public static javax.jcr.nodetype.PropertyDefinition locatePropertyDef(javax.jcr.Session session, boolean isProtected, boolean mandatory) throws javax.jcr.RepositoryException
session
- the session to access the node typesisProtected
- if true, the returned PropertyDef
is
protected, else notmandatory
- if true, the returned PropertyDef
is
mandatory, else notPropertyDef
found fitting the
requirementsjavax.jcr.RepositoryException
public static String getUndefinedChildNodeName(javax.jcr.nodetype.NodeType nodeType)
public static String getIllegalChildNodeType(javax.jcr.nodetype.NodeTypeManager manager, String legalType) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Value getValueOfType(javax.jcr.Session session, int type) throws javax.jcr.ValueFormatException, UnsupportedOperationException, javax.jcr.RepositoryException
javax.jcr.ValueFormatException
UnsupportedOperationException
javax.jcr.RepositoryException
public static javax.jcr.Value getValueAccordingToValueConstraints(javax.jcr.Session session, javax.jcr.nodetype.PropertyDefinition propDef, boolean satisfied) throws javax.jcr.ValueFormatException, javax.jcr.RepositoryException
PropertyDefinition
propDef
- The PropertyDefinition
whose constraints
will be regardedsatisfied
- If true, the returned Value
will satisfying
the constraints - If false, the returned
Value
will not satisfying the constraints.satisfied
a Value
satisfying or not satistying the constraints of
propDef
will be returned. Null will be returned if
no accordant Value
could be build.javax.jcr.ValueFormatException
javax.jcr.RepositoryException
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.