public interface TraversableAmetysObject extends AmetysObject
AmetysObject
which is traversable and allow to create children.Modifier and Type | Method and Description |
---|---|
<A extends AmetysObject> |
getChild(String path)
Retrieves a given child from its relative path.
|
default <A extends AmetysObject> |
getChildAt(int index)
Gets the child
AmetysObject at the given position |
default int |
getChildPosition(AmetysObject ao)
Returns the position of this
AmetysObject within the ordered set of its sibling objects. |
<A extends AmetysObject> |
getChildren()
Retrieves children of the current object.
|
boolean |
hasChild(String name)
Tests if this Object has at least one child with the given name.
|
equals, getId, getName, getParent, getParentPath, getPath, hashCode
<A extends AmetysObject> AmetysObjectIterable<A> getChildren() throws AmetysRepositoryException
A
- the actual type of AmetysObject
s.AmetysObjectIterable
.AmetysRepositoryException
- if an error occurs.boolean hasChild(String name) throws AmetysRepositoryException
name
- the name to test. Cannot be null
nor empty nor
begin with a '/'
and it cannot contain '/'
.true
if the named child exists,
false
otherwise.AmetysRepositoryException
- if an error occurs.<A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
null
, empty nor begin with a '/'
.A
- the actual type of AmetysObject
.path
- the path of the child which can contains a position with.
[n]
if same name sibling is allowed.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.default <A extends AmetysObject> A getChildAt(int index) throws AmetysRepositoryException, UnknownAmetysObjectException
AmetysObject
at the given positionA
- The type of children objectsindex
- the position of the AmetysObject
within the ordered set of its sibling objects.AmetysObject
if foundAmetysRepositoryException
- if an error occursUnknownAmetysObjectException
- if no object was found at this positiondefault int getChildPosition(AmetysObject ao) throws AmetysRepositoryException
AmetysObject
within the ordered set of its sibling objects.ao
- The Ametys objectAmetysObject
within the ordered set of its sibling objects.AmetysRepositoryException
- if an error occurs.