|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.jcr2spi.nodetype.ValueConstraint
public abstract class ValueConstraint
ValueConstraint
and its subclasses are used to check the
syntax of a value constraint and to test if a specific value satisfies
it.
Field Summary | |
---|---|
static ValueConstraint[] |
EMPTY_ARRAY
|
protected static org.slf4j.Logger |
log
|
Constructor Summary | |
---|---|
protected |
ValueConstraint(String qualifiedDefinition)
|
Method Summary | |
---|---|
static void |
checkValueConstraints(QPropertyDefinition pd,
QValue[] values)
Tests if the value constraints defined in the property definition pd are satisfied by the the specified values . |
static ValueConstraint |
create(int type,
String qualifiedDefinition)
Create a new ValueConstraint from the String representation. |
static ValueConstraint |
create(int type,
String definition,
NamePathResolver resolver)
|
boolean |
equals(Object other)
|
String |
getDefinition(NamePathResolver resolver)
For constraints that are not namespace prefix mapping sensitive this method returns the same result as . |
String |
getQualifiedDefinition()
By default the qualified definition is the same as the JCR definition. |
int |
hashCode()
Returns the hashCode of the definition String |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
public static final ValueConstraint[] EMPTY_ARRAY
Constructor Detail |
---|
protected ValueConstraint(String qualifiedDefinition)
Method Detail |
---|
public String getDefinition(NamePathResolver resolver)
getQualifiedDefinition()
.
Those that are namespace prefix mapping sensitive (e.g.
NameConstraint
, PathConstraint
and
ReferenceConstraint
) use the given nsResolver
to reflect the current mapping in the returned value.
In other words: subclasses, that need to make a conversion to JCR value
must overwrite this and return a value that has all qualified names
and path elements resolved.
resolver
-
getQualifiedDefinition()
public String getQualifiedDefinition()
getDefinition(NamePathResolver)
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
Object.hashCode()
public static ValueConstraint create(int type, String qualifiedDefinition) throws InvalidConstraintException
ValueConstraint
from the String representation.
Note, that the definition must be in the qualified format in case the type
indicates PropertyType.NAME
, PropertyType.PATH
or PropertyType.REFERENCE
type
- qualifiedDefinition
-
InvalidConstraintException
InvalidConstraintException
public static ValueConstraint create(int type, String definition, NamePathResolver resolver) throws InvalidConstraintException
type
- definition
- resolver
-
InvalidConstraintException
InvalidConstraintException
public static void checkValueConstraints(QPropertyDefinition pd, QValue[] values) throws ConstraintViolationException, RepositoryException
pd
are satisfied by the the specified values
.
Note that the protected flag is not checked. Also note that no
type conversions are attempted if the type of the given values does not
match the required type as specified in the given definition.
pd
- values
-
ConstraintViolationException
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |