Package com.blackbuild.klum.ast.runtime
Class KlumObjectSupport.Structure<T>
java.lang.Object
com.blackbuild.klum.ast.runtime.KlumObjectSupport.Structure<T>
- Type Parameters:
T- the root object type
- Enclosing class:
- KlumObjectSupport<T>
Structural support rooted at a completed DSL Object.
-
Method Summary
Modifier and TypeMethodDescriptionReturns every composed object assignable totype, indexed by its path from this structure root.Returns every composed object assignable totype, indexed by paths usingrootPath.<R> Optional<R>getAncestorOfType(Class<R> type) Returns the nearest owner-hierarchy member oftype, if present.Returns the non-transitive, non-root owners directly assigned to this object.Returns this object's path relative to its composition root.getFullPath(String rootPath) Returns this object's path relative to its composition root, prefixed byrootPath.Returns the direct-owner hierarchy from this object to its composition root.getRelativePath(Object child) Returns the path from this object to the supplied owned descendant.getRelativePath(Object child, String rootPath) Returns the path from this object to the supplied owned descendant, prefixed byrootPath.Returns this object's sole direct owner, if it has one.<R> voidvisit(Class<R> type, BiConsumer<String, R> visitor) Visits every composed object assignable totype.
-
Method Details
-
getDirectOwners
Returns the non-transitive, non-root owners directly assigned to this object. -
getSingleOwner
Returns this object's sole direct owner, if it has one.- Throws:
KlumModelException- if this object has more than one distinct direct owner
-
getOwnerHierarchy
Returns the direct-owner hierarchy from this object to its composition root.- Throws:
KlumSchemaException- if direct owners form a cycle
-
getAncestorOfType
Returns the nearest owner-hierarchy member oftype, if present. -
getRelativePath
Returns the path from this object to the supplied owned descendant. -
getRelativePath
Returns the path from this object to the supplied owned descendant, prefixed byrootPath. -
getFullPath
Returns this object's path relative to its composition root. -
getFullPath
Returns this object's path relative to its composition root, prefixed byrootPath. -
visit
Visits every composed object assignable totype. -
findAll
Returns every composed object assignable totype, indexed by its path from this structure root. -
findAll
Returns every composed object assignable totype, indexed by paths usingrootPath. This overload supports compatibility adapters that retain an existing path prefix.
-