Class NativeInfo
- All Implemented Interfaces:
Serializable,NodeInfo,Condition
Note:it is not thread-safe.
- Since:
- 3.0.0
- Author:
- tomyeh
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNativeInfo(NodeInfo parent, ComponentDefinition compdef, String tag) Constructs a native info with a parent.NativeInfo(EvaluatorRef evlar, ComponentDefinition compdef, String tag) Constructs a native info without a parent. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeclaredNamespace(org.zkoss.idom.Namespace ns) Adds a declared namespace.voidaddEpilogChild(NodeInfo child) Adds an epilog child.voidaddPrologChild(NodeInfo child) Adds a prolog child.Returns a readonly list of children.Returns the effectiveness condition.List<org.zkoss.idom.Namespace>Returns a readonly list of the declared namespaces (never null).Returns a readonly list of the epilog children (NativeInfo).Returns the evaluator.Returns the evaluator reference.Returns the page definition, i.e., the root node, or null if not available.Returns the parent, or null if it has no parent.Returns a readonly list of the prolog children (NativeInfo).Returns the split child, or null if not available.booleanisEffective(Component comp) Used to evaluate whether it is effective.booleanisEffective(Page page) Used to evaluate whether it is effective.newInstance(Page page, Component parent) Creates an component based on this info (never null).booleanremoveChild(NodeInfo child) Removes a child.resolveForEach(Page page, Component comp) Returns the forEach object if the forEach attribute is defined (orForEachBranchInfo.setForEach(java.lang.String, java.lang.String, java.lang.String)is called).voidsetCondition(ConditionImpl cond) Sets the effectiveness condition.voidsetForEach(String expr, String begin, String end) Sets the forEach attribute, which is usually an expression.voidsetForEach(String expr, String begin, String end, String step) Sets the forEach attribute, which is usually an expression.voidsetSplitChild(NativeInfo child) Sets the split kid.booleanTests if the condition is setbooleanReturns whether the forEach condition is defined.Methods inherited from class org.zkoss.zk.ui.metainfo.ComponentInfo
addAnnotation, addEventHandler, addProperty, addProperty, addWidgetAttribute, addWidgetListener, addWidgetOverride, appendChild, applyProperties, disableBindingAnnotation, duplicate, enableBindingAnnotation, evalProperties, getAnnotationMap, getApply, getComponentDefinition, getEventHandlerNames, getForward, getFulfill, getImplementation, getLanguageDefinition, getProperties, getReplaceableText, getTag, getTextAs, getWidgetClass, hasBindingAnnotation, isBlankPreserved, isChildAllowedInTextAs, newInstance, resolveComposer, resolveImplementationClass, resolveImplementationClass, resolveWidgetClass, setApply, setForward, setFulfill, setImplementation, setReplaceableText, setWidgetClass, toString
-
Constructor Details
-
NativeInfo
Constructs a native info with a parent.- Parameters:
parent- the parent info (never null).compdef- the component definition (never null).tag- the name of the tag
-
NativeInfo
Constructs a native info without a parent.- Parameters:
evlar- the evaluator (never null).compdef- the component definition (never null).tag- the name of the tag- Since:
- 3.5.0
-
-
Method Details
-
getDeclaredNamespaces
Returns a readonly list of the declared namespaces (never null). -
addDeclaredNamespace
public void addDeclaredNamespace(org.zkoss.idom.Namespace ns) Adds a declared namespace. -
getPrologChildren
Returns a readonly list of the prolog children (NativeInfo). A prolog child is a special child ofNativeInfo. (it is not part ofgetChildren()that is used to optimize the native components such that ZK can use one native components to represent severalNativeInfo. In other words, a prolog child won't be created as part ofThe prolog children must be rendered before
getChildren(). -
getEpilogChildren
Returns a readonly list of the epilog children (NativeInfo). The epilog children must be rendered aftergetChildren(). -
addPrologChild
Adds a prolog child.Note: if child belong to other
ComponentInfo, you have to remove them first before calling this method. Otherwise, the result is unpredictable.- Parameters:
child- the prolog child.- See Also:
-
addEpilogChild
Adds an epilog child.- Parameters:
child- the epilog child. If child belongs togetChildren(), it will be removed first.- See Also:
-
getSplitChild
Returns the split child, or null if not available. Each native info has at most one split child. If a native info has a single child and the child is also a native info, we can merge them by making the child as the split child.- Since:
- 3.0.0
-
setSplitChild
Sets the split kid.- Since:
- 3.0.0
- See Also:
-
newInstance
Description copied from class:ComponentInfoCreates an component based on this info (never null).Like
ComponentDefinition.newInstance(org.zkoss.zk.ui.Page, java.lang.String), this method doesn't invokeComponentInfo.applyProperties(org.zkoss.zk.ui.Component). It is caller's job to invoke them if necessary. Since the value of properties might depend on the component tree, it is better to assign the component with a proper parent before callingComponentInfo.applyProperties(org.zkoss.zk.ui.Component).- Overrides:
newInstancein classComponentInfo
-
resolveForEach
Returns the forEach object if the forEach attribute is defined (orForEachBranchInfo.setForEach(java.lang.String, java.lang.String, java.lang.String)is called).If comp is not null, both pagedef and page are ignored. If comp is null, page must be specified.
- Parameters:
page- the page. It is used only if comp is null.comp- the component.- Returns:
- the forEach object to iterate this info multiple times, or null if this info shall be interpreted only once.
-
setForEach
Sets the forEach attribute, which is usually an expression.- Parameters:
expr- the expression to return a collection of objects, or null/empty to denote no iteration.
-
setForEach
Sets the forEach attribute, which is usually an expression.- Parameters:
expr- the expression to return a collection of objects, or null/empty to denote no iteration.- Since:
- 8.0.0
-
withForEach
public boolean withForEach()Returns whether the forEach condition is defined. -
getCondition
Returns the effectiveness condition. -
setCondition
Sets the effectiveness condition. -
withCondition
public boolean withCondition()Tests if the condition is set -
removeChild
Description copied from interface:NodeInfoRemoves a child.- Specified by:
removeChildin interfaceNodeInfo
-
getChildren
Description copied from interface:NodeInfoReturns a readonly list of children.Note: the returned list is readonly. To modify, please use
NodeInfo.appendChild(org.zkoss.zk.ui.metainfo.NodeInfo)andNodeInfo.removeChild(org.zkoss.zk.ui.metainfo.NodeInfo)instead.- Specified by:
getChildrenin interfaceNodeInfo
-
isEffective
Description copied from interface:ConditionUsed to evaluate whether it is effective.- Specified by:
isEffectivein interfaceCondition- Parameters:
comp- used as the self variable. Ignored if null.
-
isEffective
Description copied from interface:ConditionUsed to evaluate whether it is effective.- Specified by:
isEffectivein interfaceCondition- Parameters:
page- used as the self variable. Ignored if null.
-
getEvaluatorRef
Description copied from interface:NodeInfoReturns the evaluator reference.- Specified by:
getEvaluatorRefin interfaceNodeInfo
-
getPageDefinition
Description copied from interface:NodeInfoReturns the page definition, i.e., the root node, or null if not available.- Specified by:
getPageDefinitionin interfaceNodeInfo
-
getEvaluator
Description copied from interface:NodeInfoReturns the evaluator.All nodes in the same ZUML tree has the same evaluator reference (inherited from the root node,
PageDefinition.getEvaluatorRef()).- Specified by:
getEvaluatorin interfaceNodeInfo
-
getParent
Description copied from interface:NodeInfoReturns the parent, or null if it has no parent.
-