org.apache.sling.servlets.post.impl.helper
Class ReferenceParser

java.lang.Object
  extended by 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 for parse it.


Constructor Summary
ReferenceParser(javax.jcr.Session session)
           
 
Method Summary
 javax.jcr.Value[] parse(String[] values, javax.jcr.ValueFactory factory, boolean weak)
          Parses the given source strings and returns the respective reference value instances.
 javax.jcr.Value parse(String value, javax.jcr.ValueFactory factory, boolean weak)
          Parses the given source string and returns the correct Value object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceParser

public ReferenceParser(javax.jcr.Session session)
Method Detail

parse

public javax.jcr.Value parse(String value,
                             javax.jcr.ValueFactory factory,
                             boolean weak)
                      throws javax.jcr.RepositoryException
Parses the given source string and returns the correct Value object. If no node matches returns null.

Parameters:
value - a path or UUID
factory - the value factory
weak - true to create a WeakReference value
Returns:
the value or null
Throws:
javax.jcr.RepositoryException

parse

public javax.jcr.Value[] parse(String[] values,
                               javax.jcr.ValueFactory factory,
                               boolean weak)
                        throws javax.jcr.RepositoryException
Parses the given source strings and returns the respective reference value instances. If no node matches for any of the sources returns null.

Parameters:
values - path or UUID strings
factory - the value factory
weak - true to create a WeakReference value
Returns:
the values or null
Throws:
javax.jcr.RepositoryException


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.