Module org.praxislive.code
Package org.praxislive.code
Class CodeRootContainer<D extends CodeRootContainerDelegate>
java.lang.Object
org.praxislive.code.CodeComponent<D>
org.praxislive.code.CodeRoot<D>
org.praxislive.code.CodeRootContainer<D>
- Type Parameters:
D- wrapped delegate type
- All Implemented Interfaces:
Component,Container,Lookup.Provider,Root
public class CodeRootContainer<D extends CodeRootContainerDelegate>
extends CodeRoot<D>
implements Container
A
container instance that is rewritable at runtime. The
CodeRootContainer itself remains constant, but passes most responsibility to
a
invalid reference
Root
CodeRootContainer.Context wrapping a CodeRootContainerDelegate (user code).
This component handles switching from one context to the next. A CodeRoot
cannot be created directly - see CodeFactory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCodeConnector subclass for CodeRootContainers.static classCodeContext subclass for CodeRootContainers.Nested classes/interfaces inherited from interface org.praxislive.core.Root
Root.Controller -
Method Summary
Modifier and TypeMethodDescriptionchildren()Get a Stream of the child IDs that this container makes publicly visible.getAddress(Component child) Get the address for the provided child component, or null if the component is not a child of this container.Get child component with specific ID.Get the Lookup from this Provider.voidNotify the component that a change has happened in its component hierarchy.voidwrite(TreeWriter writer) If supported, write the state of this component to the providedTreeWriter.Methods inherited from class org.praxislive.code.CodeRoot
initialize, parentNotifyMethods inherited from class org.praxislive.code.CodeComponent
getControl, getInfo, getParent, getPortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.praxislive.core.Component
getControl, getInfo, getParent, getPort, parentNotify
-
Method Details
-
children
Description copied from interface:ContainerGet a Stream of the child IDs that this container makes publicly visible. Containers may have hidden children that can be returned fromContainer.getChild(java.lang.String)but are not listed here. All IDs returned should correspond to valid components, and (if provided) match the implementation ofContainerProtocol.A Stream is returned allowing flexibility in implementation.
-
getAddress
Description copied from interface:ContainerGet the address for the provided child component, or null if the component is not a child of this container.- Specified by:
getAddressin interfaceContainer- Parameters:
child- component- Returns:
- address, or null of component is not a child of this container.
-
getChild
Description copied from interface:ContainerGet child component with specific ID. -
getLookup
Description copied from interface:Lookup.ProviderGet the Lookup from this Provider.- Specified by:
getLookupin interfaceLookup.Provider- Overrides:
getLookupin classCodeRoot<D extends CodeRootContainerDelegate>- Returns:
- lookup
-
hierarchyChanged
public void hierarchyChanged()Description copied from interface:ComponentNotify the component that a change has happened in its component hierarchy. For example its direct parent or an ancestor has changed. This method will be called after parentNotify() if the result of an immediate parent change.- Specified by:
hierarchyChangedin interfaceComponent- Overrides:
hierarchyChangedin classCodeRoot<D extends CodeRootContainerDelegate>
-
write
Description copied from interface:ComponentIf supported, write the state of this component to the providedTreeWriter. This should allow for the component to be recreated in as close to its current state as possible.To fully support this method, the Component should write its type, component info, and property values, in that order. It may also add custom annotations.
The component should delegate to
Container.getType(org.praxislive.core.Component)to find its type rather than relying directly onComponentInfo.KEY_COMPONENT_TYPE.The default implementation of this method does nothing.
- Specified by:
writein interfaceComponent- Specified by:
writein interfaceContainer- Overrides:
writein classCodeComponent<D extends CodeRootContainerDelegate>- Parameters:
writer- TreeWriter to write to
-