public class JcrResourceUtil extends Object
JcrResourceUtil
class provides helper methods used
throughout this bundle.Constructor and Description |
---|
JcrResourceUtil() |
Modifier and Type | Method and Description |
---|---|
static javax.jcr.Value |
createValue(Object value,
javax.jcr.Session session)
Creates a
JCR Value for the given object with
the given Session. |
static javax.jcr.query.QueryResult |
query(javax.jcr.Session session,
String query,
String language)
Helper method to execute a JCR query.
|
static Object |
toJavaObject(javax.jcr.Property property)
Converts the value(s) of a JCR Property to a corresponding Java Object.
|
static Object |
toJavaObject(javax.jcr.Value value)
Converts a JCR Value to a corresponding Java Object
|
public static javax.jcr.query.QueryResult query(javax.jcr.Session session, String query, String language) throws javax.jcr.RepositoryException
session
- the sessionquery
- the querylanguage
- the languagejavax.jcr.RepositoryException
- if the QueryManager
cannot be retrievedpublic static Object toJavaObject(javax.jcr.Value value) throws javax.jcr.RepositoryException
value
- the JCR Value to convertjavax.jcr.RepositoryException
- if the value cannot be convertedpublic static Object toJavaObject(javax.jcr.Property property) throws javax.jcr.RepositoryException
property
- the property to be converted to the corresponding Java Objectjavax.jcr.RepositoryException
- if the conversion cannot take placepublic static javax.jcr.Value createValue(Object value, javax.jcr.Session session) throws javax.jcr.RepositoryException
JCR Value
for the given object with
the given Session.
Selects the the PropertyType
according
the instance of the object's Classvalue
- objectsession
- to create value forjavax.jcr.RepositoryException
- in case of error, accessing the RepositoryCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.