Class ReferenceParser
- java.lang.Object
-
- org.apache.sling.servlets.post.impl.helper.ReferenceParser
-
public class ReferenceParser extends Object
Takes a string representation of a node (either a path or a uuid) and tries to parse it. ReferenceParser is only used if JCR is available.
-
-
Constructor Summary
Constructors Constructor Description ReferenceParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.jcr.Value[]parse(javax.jcr.Session session, String[] values, boolean weak)Parses the given source strings and returns the respective reference value instances.static javax.jcr.Valueparse(javax.jcr.Session session, String value, boolean weak)Parses the given source string and returns the correct Value object.
-
-
-
Method Detail
-
parse
public static javax.jcr.Value parse(javax.jcr.Session session, String value, boolean weak) throws javax.jcr.RepositoryExceptionParses the given source string and returns the correct Value object. If no node matches returnsnull.- Parameters:
session- the sessionvalue- a path or UUIDweak- true to create a WeakReference value- Returns:
- the value or
null - Throws:
javax.jcr.RepositoryException- in case of problems
-
parse
public static javax.jcr.Value[] parse(javax.jcr.Session session, String[] values, boolean weak) throws javax.jcr.RepositoryExceptionParses the given source strings and returns the respective reference value instances. If no node matches for any of the sources returnsnull.- Parameters:
session- the sessionvalues- path or UUID stringsweak- true to create a WeakReference value- Returns:
- the values or
null - Throws:
javax.jcr.RepositoryException- in case of problems
-
-