namespace sap.ui.core.util.reflection.BaseTreeModifier

Visiblity: restricted
Available since: N/A
Module: sap/ui/core/util/reflection/BaseTreeModifier
Application Component: CA-UI5-COR

Abstract static utility class to access ManagedObjects and XMLNodes that represent ManagedObjects in a harmonized way.

The class mirrors the ManagedObject API so that code that needs to work with ManagedObjects in several representations can be written in a harmonized way. The slight differences are handled by specifying a super set of parameters that might not be needed in all use cases. For example sap.ui.fl uses this class and its subtypes for change handlers that can be applied on XMLViews and normal ManagedObject instances.


Nodes Overview

Node Description

Methods Overview

Method Description
sap.ui.core.util.reflection.BaseTreeModifier._getFlexCustomData

Gets the "sap.ui.fl" namespaced special settings in the custom data.

The method is not to be used directly, but to be implemented by modifiers

sap.ui.core.util.reflection.BaseTreeModifier.applySettings

See sap.ui.base.ManagedObject#applySettings method.

sap.ui.core.util.reflection.BaseTreeModifier.attachEvent

Attaches event on the specified ManagedObject.

sap.ui.core.util.reflection.BaseTreeModifier.bindAggregation

See sap.ui.base.ManagedObject#bindAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.bindProperty

See sap.ui.base.ManagedObject#bindProperty method.

sap.ui.core.util.reflection.BaseTreeModifier.bySelector

Function determining the control targeted by the change.

sap.ui.core.util.reflection.BaseTreeModifier.bySelectorExtensionPointEnabled

Function determining the control targeted by the change. It is also possible to pass an extensionpoint selector. In this case an extension point is referenced in the selector but the parent control of the extensionpoint will be returned.

sap.ui.core.util.reflection.BaseTreeModifier.bySelectorTypeIndependent

Function determining the control targeted by the change.

sap.ui.core.util.reflection.BaseTreeModifier.checkControlId

Checks if the control ID is generated or maintained by the application.

sap.ui.core.util.reflection.BaseTreeModifier.createControl

Creates the control in the corresponding representation.

sap.ui.core.util.reflection.BaseTreeModifier.destroy

Cleans up the resources associated with this object and all its aggregated children. See sap.ui.base.ManagedObject#destroy method.

After an object has been destroyed, it can no longer be used! Applications should call this method if they don't need the object any longer.

sap.ui.core.util.reflection.BaseTreeModifier.detachEvent

Detaches event from the specified ManagedObject.

sap.ui.core.util.reflection.BaseTreeModifier.findIndexInParentAggregation

Finds the index of the control in its parent aggregation.

sap.ui.core.util.reflection.BaseTreeModifier.getAggregation

See sap.ui.base.ManagedObject#getAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.getAllAggregations

See sap.ui.base.ManagedObjectMetadata#getAllAggregations method.

sap.ui.core.util.reflection.BaseTreeModifier.getAssociation

See sap.ui.base.ManagedObject#getAssociation method.

sap.ui.core.util.reflection.BaseTreeModifier.getBindingTemplate

Gets the binding template from an aggregation. See sap.ui.base.ManagedObject#getBindingInfo method.

sap.ui.core.util.reflection.BaseTreeModifier.getChangeHandlerModulePath

Returns the module path of an instance specific change handler.

sap.ui.core.util.reflection.BaseTreeModifier.getControlIdBySelector

Function determining the control ID from the selector.

sap.ui.core.util.reflection.BaseTreeModifier.getControlType

See sap.ui.base.Metadata#getName method.

sap.ui.core.util.reflection.BaseTreeModifier.getFlexDelegate

Gets the flexibility delegate information placed at a control.

sap.ui.core.util.reflection.BaseTreeModifier.getId

See sap.ui.base.ManagedObject#getId method.

sap.ui.core.util.reflection.BaseTreeModifier.getParent

See sap.ui.base.ManagedObject#getParent method.

sap.ui.core.util.reflection.BaseTreeModifier.getParentAggregationName

Removes all objects from the aggregation of the given control.

sap.ui.core.util.reflection.BaseTreeModifier.getProperty

See sap.ui.base.ManagedObject#getProperty method.

sap.ui.core.util.reflection.BaseTreeModifier.getPropertyBinding

See sap.ui.base.ManagedObject#getBindingInfo method.

sap.ui.core.util.reflection.BaseTreeModifier.getPropertyBindingOrProperty

Checks if there is a property binding and returns it if available, otherwise returns the value of the property.

sap.ui.core.util.reflection.BaseTreeModifier.getSelector

Function for determining the selector that is used later to apply a change for a given control.

sap.ui.core.util.reflection.BaseTreeModifier.getStashed

Retrieves the current value of the stashed property.

sap.ui.core.util.reflection.BaseTreeModifier.getVisible

See sap.ui.core.Control#getVisible method.

sap.ui.core.util.reflection.BaseTreeModifier.hasLocalIdSuffix

Checks if a control ID has a prefix matching the application component. If this prefix exists, the suffix after the component ID is called the local ID.

sap.ui.core.util.reflection.BaseTreeModifier.insertAggregation

See sap.ui.base.ManagedObject#insertAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.instantiateFragment

Loads a fragment and turns the result into an array of nodes; also prefixes all the controls with a given namespace; throws an error if there is at least one control in the fragment without a stable ID or has a duplicate ID in the given view.

sap.ui.core.util.reflection.BaseTreeModifier.isPropertyInitial

See sap.ui.base.ManagedObject#isPropertyInitial method.

sap.ui.core.util.reflection.BaseTreeModifier.removeAggregation

Removes the object from the aggregation of the given control. See sap.ui.base.ManagedObject#removeAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.removeAllAggregation

Removes all objects from the aggregation of the given control. See sap.ui.base.ManagedObject#removeAllAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.setAssociation

See sap.ui.base.ManagedObject#setAssociation method.

sap.ui.core.util.reflection.BaseTreeModifier.setProperty

See sap.ui.base.ManagedObject#setProperty method.

sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBinding

Similar as #bindProperty, but allows to specify binding like in control constructor.

sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBindingOrProperty

Calls sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBinding if the passed value is a binding info object or binding string, otherwise calls sap.ui.core.util.reflection.BaseTreeModifier.setProperty.

sap.ui.core.util.reflection.BaseTreeModifier.setStashed

Sets the new value for stashed and visible.

sap.ui.core.util.reflection.BaseTreeModifier.setVisible

See sap.ui.core.Control#setVisible method.

sap.ui.core.util.reflection.BaseTreeModifier.templateControlFragment

Loads a fragment, processes the XML templating and turns the result into an array of nodes or controls. See sap.ui.core.util.XMLPreprocessor.process

sap.ui.core.util.reflection.BaseTreeModifier.unbindAggregation

See sap.ui.base.ManagedObject#unbindAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.unbindProperty

See sap.ui.base.ManagedObject#unbindProperty method.

sap.ui.core.util.reflection.BaseTreeModifier.updateAggregation

See sap.ui.base.ManagedObject#updateAggregation method.

sap.ui.core.util.reflection.BaseTreeModifier.validateType

Validates if the control has the correct type for the aggregation.

sap.ui.core.util.reflection.BaseTreeModifier._getFlexCustomData

Gets the "sap.ui.fl" namespaced special settings in the custom data.

The method is not to be used directly, but to be implemented by modifiers

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.applySettings

See sap.ui.base.ManagedObject#applySettings method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

mSettings object

Further settings or properties for the control

sap.ui.core.util.reflection.BaseTreeModifier.attachEvent

Attaches event on the specified ManagedObject.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sEventName string

Event name

sFunctionPath string

Absolute path to a function

vData object

Predefined values for event handler function

sap.ui.core.util.reflection.BaseTreeModifier.bindAggregation

See sap.ui.base.ManagedObject#bindAggregation method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name

vBindingInfos object

Binding info

sap.ui.core.util.reflection.BaseTreeModifier.bindProperty

See sap.ui.base.ManagedObject#bindProperty method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

vBindingInfos object

Binding info

sap.ui.core.util.reflection.BaseTreeModifier.bySelector

Function determining the control targeted by the change.

Param Type DefaultValue Description
oSelector object

Target of a flexibility change

id string

ID of the control targeted by the change. (name or id property is mandatory for selector)

isLocalId boolean

true if the ID within the selector is a local ID or a global ID

oAppComponent sap.ui.core.UIComponent

Application component

oView Element

For XML processing only: XML node of the view

sap.ui.core.util.reflection.BaseTreeModifier.bySelectorExtensionPointEnabled

Function determining the control targeted by the change. It is also possible to pass an extensionpoint selector. In this case an extension point is referenced in the selector but the parent control of the extensionpoint will be returned.

Param Type DefaultValue Description
oSelector object

Target of a flexibility change

id string

ID of the control targeted by the change. (name or id property is mandatory for selector)

isLocalId boolean

true if the ID within the selector is a local ID or a global ID

name string

Name of the extension point targeted by the change. (name or id property is mandatory for selector)

oAppComponent sap.ui.core.UIComponent

Application component

oView Element

For XML processing only: XML node of the view

sap.ui.core.util.reflection.BaseTreeModifier.bySelectorTypeIndependent

Function determining the control targeted by the change.

Param Type DefaultValue Description
oSelector object

Target of a flexibility change

id string

ID of the control targeted by the change. (name or id property is mandatory for selector)

isLocalId boolean

true if the ID within the selector is a local ID or a global ID

name string

Name of the extension point targeted by the change. (name or id property is mandatory for selector)

oAppComponent sap.ui.core.UIComponent

Application component

oView Element

For XML processing only: XML node of the view

sap.ui.core.util.reflection.BaseTreeModifier.checkControlId

Checks if the control ID is generated or maintained by the application.

Param Type DefaultValue Description
vControl sap.ui.core.Control string

Control instance or ID

oAppComponent sap.ui.core.Component

oAppComponent application component, needed only if vControl is a string (ID)

sap.ui.core.util.reflection.BaseTreeModifier.createControl

Creates the control in the corresponding representation.

Param Type DefaultValue Description
sClassName string

Class name for the control (for example, sap.m.Button), ensures that the class is loaded (no synchronous requests are called)

oAppComponent sap.ui.core.UIComponent

Needed to calculate the correct ID in case you provide an ID

oView Element

XML node of the view, required for XML case to create nodes and to find elements

oSelector object

Selector to calculate the ID for the control that is created

id string

Control ID targeted by the change

isLocalId boolean

true if the ID within the selector is a local ID or a global ID

mSettings object

Further settings or properties for the control that is created

sap.ui.core.util.reflection.BaseTreeModifier.destroy

Cleans up the resources associated with this object and all its aggregated children. See sap.ui.base.ManagedObject#destroy method.

After an object has been destroyed, it can no longer be used! Applications should call this method if they don't need the object any longer.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

bSuppressInvalidate boolean

if true, this ManagedObject is not marked as changed

sap.ui.core.util.reflection.BaseTreeModifier.detachEvent

Detaches event from the specified ManagedObject.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sEventName string

Event name

sFunctionPath string

Absolute path to a function

sap.ui.core.util.reflection.BaseTreeModifier.findIndexInParentAggregation

Finds the index of the control in its parent aggregation.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getAggregation

See sap.ui.base.ManagedObject#getAggregation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control which has the aggregation

sName string

Aggregation name

sap.ui.core.util.reflection.BaseTreeModifier.getAllAggregations

See sap.ui.base.ManagedObjectMetadata#getAllAggregations method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getAssociation

See sap.ui.base.ManagedObject#getAssociation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control which has the association

sName string

Association name

sap.ui.core.util.reflection.BaseTreeModifier.getBindingTemplate

Gets the binding template from an aggregation. See sap.ui.base.ManagedObject#getBindingInfo method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name

sap.ui.core.util.reflection.BaseTreeModifier.getChangeHandlerModulePath

Returns the module path of an instance specific change handler.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getControlIdBySelector

Function determining the control ID from the selector.

Param Type DefaultValue Description
oSelector object

Target of a flexiblity change

id string

ID of the control targeted by the change

isLocalId boolean

true if the ID within the selector is a local ID or a global ID

oAppComponent sap.ui.core.UIComponent

Application component

sap.ui.core.util.reflection.BaseTreeModifier.getControlType

See sap.ui.base.Metadata#getName method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getFlexDelegate

Gets the flexibility delegate information placed at a control.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getId

See sap.ui.base.ManagedObject#getId method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getParent

See sap.ui.base.ManagedObject#getParent method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getParentAggregationName

Removes all objects from the aggregation of the given control.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

vParent sap.ui.base.ManagedObject Element

Control representation of the parent only needed in XML case

sap.ui.core.util.reflection.BaseTreeModifier.getProperty

See sap.ui.base.ManagedObject#getProperty method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

sap.ui.core.util.reflection.BaseTreeModifier.getPropertyBinding

See sap.ui.base.ManagedObject#getBindingInfo method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

sap.ui.core.util.reflection.BaseTreeModifier.getPropertyBindingOrProperty

Checks if there is a property binding and returns it if available, otherwise returns the value of the property.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

sap.ui.core.util.reflection.BaseTreeModifier.getSelector

Function for determining the selector that is used later to apply a change for a given control.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element string

Control or ID string for which the selector should be determined

oAppComponent sap.ui.core.Component

Application component, needed only if vControl is a string or XML node

mAdditionalSelectorInformation object

Additional mapped data which is added to the selector

sap.ui.core.util.reflection.BaseTreeModifier.getStashed

Retrieves the current value of the stashed property.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.getVisible

See sap.ui.core.Control#getVisible method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sap.ui.core.util.reflection.BaseTreeModifier.hasLocalIdSuffix

Checks if a control ID has a prefix matching the application component. If this prefix exists, the suffix after the component ID is called the local ID.

Param Type DefaultValue Description
vControl sap.ui.core.Control string

Control or ID to be checked if it is within the generic application

oAppComponent sap.ui.core.UIComponent

Application component, needed only if vControl is a string (ID)

sap.ui.core.util.reflection.BaseTreeModifier.insertAggregation

See sap.ui.base.ManagedObject#insertAggregation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control which has the aggregation

sAggregationName string

Aggregation name

oObject sap.ui.base.ManagedObject Element

XML node or element of the control that will be inserted

iIndex int

Index for oObject in the aggregation

oView Element

XML node of the view, needed in XML case to potentially create (aggregation) nodes

bSkipAdjustIndex boolean

true in case of inserting an XML node or element at an extension point, needed only in XML case

sap.ui.core.util.reflection.BaseTreeModifier.instantiateFragment

Loads a fragment and turns the result into an array of nodes; also prefixes all the controls with a given namespace; throws an error if there is at least one control in the fragment without a stable ID or has a duplicate ID in the given view.

Param Type DefaultValue Description
sFragment string

XML fragment as string

sNamespace string

Namespace of the app

oView sap.ui.core.mvc.View

View for the fragment

sap.ui.core.util.reflection.BaseTreeModifier.isPropertyInitial

See sap.ui.base.ManagedObject#isPropertyInitial method.

Param Type DefaultValue Description
oControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

sap.ui.core.util.reflection.BaseTreeModifier.removeAggregation

Removes the object from the aggregation of the given control. See sap.ui.base.ManagedObject#removeAggregation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name

oObject sap.ui.base.ManagedObject Element

Aggregated object to be set

sap.ui.core.util.reflection.BaseTreeModifier.removeAllAggregation

Removes all objects from the aggregation of the given control. See sap.ui.base.ManagedObject#removeAllAggregation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name

sap.ui.core.util.reflection.BaseTreeModifier.setAssociation

See sap.ui.base.ManagedObject#setAssociation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control which has the association

sName string

Association name

sId string sap.ui.base.ManagedObject Element

ID of the managed object that is set as an association, or the managed object or XML node itself or null

sap.ui.core.util.reflection.BaseTreeModifier.setProperty

See sap.ui.base.ManagedObject#setProperty method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

vPropertyValue any

New value for the property

sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBinding

Similar as #bindProperty, but allows to specify binding like in control constructor.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

vPropertyBinding any

See source of sap.ui.base.ManagedObject#extractBindingInfo method

sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBindingOrProperty

Calls sap.ui.core.util.reflection.BaseTreeModifier.setPropertyBinding if the passed value is a binding info object or binding string, otherwise calls sap.ui.core.util.reflection.BaseTreeModifier.setProperty.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name

vBindingOrValue any

Property binding or property value

sap.ui.core.util.reflection.BaseTreeModifier.setStashed

Sets the new value for stashed and visible.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

bStashed boolean

New value for stashed property

sap.ui.core.util.reflection.BaseTreeModifier.setVisible

See sap.ui.core.Control#setVisible method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

bVisible boolean

New value for visible property

sap.ui.core.util.reflection.BaseTreeModifier.templateControlFragment

Loads a fragment, processes the XML templating and turns the result into an array of nodes or controls. See sap.ui.core.util.XMLPreprocessor.process

Param Type DefaultValue Description
sFragmentName string

XML fragment name (e.g. some.path.fragmentName)

mPreprocessorSettings object {}

Map/JSON object with initial property values, etc.

bindingContexts object

Binding contexts relevant for template pre-processing

models object

Models relevant for template pre-processing

oView sap.ui.core.mvc.View

View for the fragment, only needed on JS side

sap.ui.core.util.reflection.BaseTreeModifier.unbindAggregation

See sap.ui.base.ManagedObject#unbindAggregation method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name to be unbound

sap.ui.core.util.reflection.BaseTreeModifier.unbindProperty

See sap.ui.base.ManagedObject#unbindProperty method.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control representation

sPropertyName string

Property name to be unbound

sap.ui.core.util.reflection.BaseTreeModifier.updateAggregation

See sap.ui.base.ManagedObject#updateAggregation method.

Param Type DefaultValue Description
vParent sap.ui.base.ManagedObject Element

Control representation

sAggregationName string

Aggregation name

sap.ui.core.util.reflection.BaseTreeModifier.validateType

Validates if the control has the correct type for the aggregation.

Param Type DefaultValue Description
vControl sap.ui.base.ManagedObject Element

Control whose type is to be checked

mAggregationMetadata object

Aggregation info object

vParent sap.ui.base.ManagedObject Element

Parent of the control

sFragment string

Path to the fragment that contains the control whose type is to be checked

iIndex int

Index of the current control in the parent aggregation