public final class TraversableAmetysObjectHelper extends Object
TraversableAmetysObject
stored in JCR.Modifier | Constructor and Description |
---|---|
private |
TraversableAmetysObjectHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
_checkLock(Node node) |
private static String |
_computeSubPath(String[] pathElements,
int beginIndex) |
private static String |
_escape(String qName) |
private static VirtualAmetysObjectFactory |
_getVirtualFactory(String id,
AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint,
Logger logger) |
static <A extends AmetysObject> |
createChild(JCRTraversableAmetysObject object,
JCRAmetysObjectFactory factory,
String name,
String type,
AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint,
AmetysObjectResolver resolver,
Logger logger)
Creates a child to the given object.
|
static <A extends AmetysObject> |
getChild(JCRTraversableAmetysObject object,
JCRAmetysObjectFactory factory,
String path,
AmetysObjectResolver resolver,
Logger logger)
Returns the
AmetysObject at the given subPath,
relative to the given DefaultTraversableAmetysObject . |
static <A extends AmetysObject> |
getChildren(JCRTraversableAmetysObject object,
JCRAmetysObjectFactory factory,
AmetysObjectResolver resolver,
Logger logger)
Returns all children of the given
DefaultTraversableAmetysObject . |
static boolean |
hasChild(JCRTraversableAmetysObject object,
String name,
AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint,
Logger logger)
Tests if a given object has a child with a given name.
|
private TraversableAmetysObjectHelper()
public static <A extends AmetysObject> A getChild(JCRTraversableAmetysObject object, JCRAmetysObjectFactory factory, String path, AmetysObjectResolver resolver, Logger logger) throws AmetysRepositoryException, UnknownAmetysObjectException
AmetysObject
at the given subPath,
relative to the given DefaultTraversableAmetysObject
.A
- the actual type of AmetysObject
.object
- the context DefaultTraversableAmetysObject
.factory
- the corresponding JCRAmetysObjectFactory
.path
- the sub path. Cannot be null
, empty or absolute.resolver
- the AmetysObjectResolver
.logger
- a Logger
for traces.AmetysObject
at the given subPath,
relative to the given DefaultTraversableAmetysObject
.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if no such object exists.private static String _computeSubPath(String[] pathElements, int beginIndex)
public static <A extends AmetysObject> AmetysObjectIterable<A> getChildren(JCRTraversableAmetysObject object, JCRAmetysObjectFactory factory, AmetysObjectResolver resolver, Logger logger) throws AmetysRepositoryException
DefaultTraversableAmetysObject
.A
- the actual type of AmetysObject
sobject
- a DefaultTraversableAmetysObject
.factory
- the corresponding JCRAmetysObjectFactory
.resolver
- the AmetysObjectResolver
.logger
- a Logger
for traces.AmetysRepositoryException
- if an error occurs.public static boolean hasChild(JCRTraversableAmetysObject object, String name, AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint, Logger logger) throws AmetysRepositoryException
object
- the context object.name
- the name to test.ametysFactoryExtensionPoint
- the AmetysObjectFactoryExtensionPoint
.logger
- a Logger
for traces.true
is the given object has a child with the given name,
false
otherwise.AmetysRepositoryException
- if an error occurs.private static VirtualAmetysObjectFactory _getVirtualFactory(String id, AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint, Logger logger)
public static <A extends AmetysObject> A createChild(JCRTraversableAmetysObject object, JCRAmetysObjectFactory factory, String name, String type, AmetysObjectFactoryExtensionPoint ametysFactoryExtensionPoint, AmetysObjectResolver resolver, Logger logger) throws AmetysRepositoryException
A
- the actual type of AmetysObject
.object
- the parent AmetysObject
.factory
- the corresponding JCRAmetysObjectFactory
.name
- the new object's name.type
- the new object's type.ametysFactoryExtensionPoint
- the AmetysObjectFactoryExtensionPoint
.resolver
- the AmetysObjectResolver
.logger
- a Logger
for traces.AmetysObject
.AmetysRepositoryException
- if an error occurs.private static void _checkLock(Node node) throws RepositoryException
RepositoryException