public class PropertyUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BASE_CHAR |
static String |
COMBINING_CHAR |
static String |
DIGIT |
static String |
EXTENDER |
static String |
IDEOGRAPHIC |
static String |
LETTER |
static String |
NC_NAME |
static Pattern |
PATTERN_DATE |
static Pattern |
PATTERN_NAME |
static Pattern |
PATTERN_PATH |
static String |
PATTERNSTRING_DATE |
static String |
PATTERNSTRING_NAME |
static String |
PATTERNSTRING_PATH |
static String |
PATTERNSTRING_PATH_ELEMENT |
static String |
PATTERNSTRING_PATH_WITHOUT_LAST_SLASH |
static String |
SIMPLENAME_CHAR |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkGetType(Property prop,
int propType)
Helper method to test the type received with Value.getType() and
Property.getType() .
|
static boolean |
checkNameFormat(String name,
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(String jcrPath,
Session session)
Checks if the given path follows the path syntax rules.
|
static long |
countBytes(Value val)
Counts the number of bytes of a Binary value.
|
static boolean |
equalValues(Value val1,
Value val2)
Helper method to compare the equality of two values for equality with the
fulfilling of the equality conditions.
|
static Value |
getValue(Property prop)
Returns the value of a property.
|
static boolean |
isDateFormat(String str)
Checks if the String is a valid date in string format.
|
static boolean |
nullValues(Node node)
Helper method to assure that no property with a null value exist.
|
static Property |
searchMultivalProp(Node node)
Helper method to find a multivalue property.
|
static Property |
searchMultivalProp(Node node,
int type)
Helper method to find a multivalue property of a given type.
|
static Property |
searchProp(Session session,
Node node,
int type,
Boolean multiple)
Traverses a tree below a given node searching for a property with a given
type
|
static Property |
searchSingleValuedProperty(Node node)
Retrieve a single valued property from the given node.
|
public static final String BASE_CHAR
public static final String IDEOGRAPHIC
public static final String COMBINING_CHAR
public static final String DIGIT
public static final String EXTENDER
public static final String LETTER
public static final String NC_NAME
public static final String SIMPLENAME_CHAR
public static final String PATTERNSTRING_NAME
public static final Pattern PATTERN_NAME
public static final String PATTERNSTRING_PATH_ELEMENT
public static final String PATTERNSTRING_PATH_WITHOUT_LAST_SLASH
public static final String PATTERNSTRING_PATH
public static final Pattern PATTERN_PATH
public static final String PATTERNSTRING_DATE
public static final Pattern PATTERN_DATE
public static Property searchProp(Session session, Node node, int type, Boolean multiple) throws RepositoryException, ValueFormatException
node
- the node to start traversetype
- the property type to search formultiple
- whether the property should be multivalued (null
: does not matter)RepositoryException
ValueFormatException
public static Value getValue(Property prop) throws RepositoryException
prop
is multi valued
this method returns the first value.prop
- the property from which to return the value.RepositoryException
public static boolean checkNameFormat(String name, Session session) throws RepositoryException
name
- the string to testRepositoryException
public static boolean checkPathFormat(String jcrPath, Session session) throws RepositoryException
jcrPath
- the string to testRepositoryException
public static boolean isDateFormat(String str)
str
- the string to test.true
if str
is a valid date format.public static long countBytes(Value val)
val
- the binary value.public static boolean checkGetType(Property prop, int propType) throws RepositoryException
RepositoryException
public static boolean equalValues(Value val1, Value val2) throws RepositoryException
val1
- first valueval2
- second valueRepositoryException
public static boolean nullValues(Node node) throws RepositoryException
node
- the node to start the search from.true
if a null value property is found;
false
in the other case.RepositoryException
public static Property searchMultivalProp(Node node) throws RepositoryException
node
- the node to start the search from.RepositoryException
public static Property searchMultivalProp(Node node, int type) throws RepositoryException
node
- the node to start the search from.type
- the property type.RepositoryException
public static Property searchSingleValuedProperty(Node node) throws RepositoryException, ValueFormatException
node
- RepositoryException
ValueFormatException
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.