|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.test.api.PropertyUtil
public class PropertyUtil
This class provides various utility methods that are used by the property test cases.
Field Summary | |
---|---|
static java.lang.String |
BASE_CHAR
|
static java.lang.String |
COMBINING_CHAR
|
static java.lang.String |
DIGIT
|
static java.lang.String |
EXTENDER
|
static java.lang.String |
IDEOGRAPHIC
|
static java.lang.String |
LETTER
|
static java.lang.String |
NC_NAME
|
static java.util.regex.Pattern |
PATTERN_DATE
|
static java.util.regex.Pattern |
PATTERN_NAME
|
static java.util.regex.Pattern |
PATTERN_PATH
|
static java.lang.String |
PATTERNSTRING_DATE
|
static java.lang.String |
PATTERNSTRING_NAME
|
static java.lang.String |
PATTERNSTRING_PATH
|
static java.lang.String |
PATTERNSTRING_PATH_ELEMENT
|
static java.lang.String |
PATTERNSTRING_PATH_WITHOUT_LAST_SLASH
|
static java.lang.String |
SIMPLENAME_CHAR
|
Method Summary | |
---|---|
static boolean |
checkGetType(javax.jcr.Property prop,
int propType)
Helper method to test the type received with Value.getType() and Property.getType() . |
static boolean |
checkNameFormat(java.lang.String name,
javax.jcr.Session session)
checks if the given name follows the NAME syntax rules and if a present prefix is mapped to a registered namespace |
static boolean |
checkPathFormat(java.lang.String jcrPath,
javax.jcr.Session session)
Checks if the given path follows the path syntax rules. |
static long |
countBytes(javax.jcr.Value val)
Counts the number of bytes of a Binary value. |
static boolean |
equalValues(javax.jcr.Value val1,
javax.jcr.Value val2)
Helper method to compare the equality of two values for equality with the fulfilling of the equality conditions. |
static javax.jcr.Value |
getValue(javax.jcr.Property prop)
Returns the value of a property. |
static boolean |
isDateFormat(java.lang.String str)
Checks if the String is a valid date in string format. |
static boolean |
nullValues(javax.jcr.Node node)
Helper method to assure that no property with a null value exist. |
static javax.jcr.Property |
searchMultivalProp(javax.jcr.Node node)
Helper method to find a multivalue property. |
static javax.jcr.Property |
searchMultivalProp(javax.jcr.Node node,
int type)
Helper method to find a multivalue property of a given type. |
static javax.jcr.Property |
searchProp(javax.jcr.Session session,
javax.jcr.Node node,
int type,
java.lang.Boolean multiple)
Traverses a tree below a given node searching for a property with a given type |
static javax.jcr.Property |
searchSingleValuedProperty(javax.jcr.Node node)
Retrieve a single valued property from the given node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BASE_CHAR
public static final java.lang.String IDEOGRAPHIC
public static final java.lang.String COMBINING_CHAR
public static final java.lang.String DIGIT
public static final java.lang.String EXTENDER
public static final java.lang.String LETTER
public static final java.lang.String NC_NAME
public static final java.lang.String SIMPLENAME_CHAR
public static final java.lang.String PATTERNSTRING_NAME
public static final java.util.regex.Pattern PATTERN_NAME
public static final java.lang.String PATTERNSTRING_PATH_ELEMENT
public static final java.lang.String PATTERNSTRING_PATH_WITHOUT_LAST_SLASH
public static final java.lang.String PATTERNSTRING_PATH
public static final java.util.regex.Pattern PATTERN_PATH
public static final java.lang.String PATTERNSTRING_DATE
public static final java.util.regex.Pattern PATTERN_DATE
Method Detail |
---|
public static javax.jcr.Property searchProp(javax.jcr.Session session, javax.jcr.Node node, int type, java.lang.Boolean multiple) throws javax.jcr.RepositoryException, javax.jcr.ValueFormatException
node
- the node to start traversetype
- the property type to search formultiple
- whether the property should be multivalued (null
: does not matter)
javax.jcr.RepositoryException
javax.jcr.ValueFormatException
public static javax.jcr.Value getValue(javax.jcr.Property prop) throws javax.jcr.RepositoryException
prop
is multi valued
this method returns the first value.
prop
- the property from which to return the value.
javax.jcr.RepositoryException
public static boolean checkNameFormat(java.lang.String name, javax.jcr.Session session) throws javax.jcr.RepositoryException
name
- the string to test
javax.jcr.RepositoryException
public static boolean checkPathFormat(java.lang.String jcrPath, javax.jcr.Session session) throws javax.jcr.RepositoryException
jcrPath
- the string to test
javax.jcr.RepositoryException
public static boolean isDateFormat(java.lang.String str)
str
- the string to test.
true
if str
is a valid date format.public static long countBytes(javax.jcr.Value val)
val
- the binary value.
public static boolean checkGetType(javax.jcr.Property prop, int propType) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static boolean equalValues(javax.jcr.Value val1, javax.jcr.Value val2) throws javax.jcr.RepositoryException
val1
- first valueval2
- second value
javax.jcr.RepositoryException
public static boolean nullValues(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- the node to start the search from.
true
if a null value property is found;
false
in the other case.
javax.jcr.RepositoryException
public static javax.jcr.Property searchMultivalProp(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- the node to start the search from.
javax.jcr.RepositoryException
public static javax.jcr.Property searchMultivalProp(javax.jcr.Node node, int type) throws javax.jcr.RepositoryException
node
- the node to start the search from.type
- the property type.
javax.jcr.RepositoryException
public static javax.jcr.Property searchSingleValuedProperty(javax.jcr.Node node) throws javax.jcr.RepositoryException, javax.jcr.ValueFormatException
node
-
javax.jcr.RepositoryException
javax.jcr.ValueFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |