Class BaseComponent

java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.eclnt.jsfserver.elements.BaseComponent
All Implemented Interfaces:
Serializable, EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, IBaseComponent, ICCComponentProperties, ICCServerConstants
Direct Known Subclasses:
BaseActionComponent, BaseHTMLComponent

public abstract class BaseComponent extends javax.faces.component.UIComponentBase implements IBaseComponent, Serializable, ICCComponentProperties, ICCServerConstants
Central class for all server-side component representations.
See Also:
  • Field Details

    • m_lastDumpRequestSequenceId

      protected long m_lastDumpRequestSequenceId
    • m_previousDump

      protected Object[] m_previousDump
    • m_currentDump

      protected Object[] m_currentDump
    • m_tagAttributes

      protected List<String> m_tagAttributes
    • m_attributesTakeOverInfo

      protected boolean[] m_attributesTakeOverInfo
    • m_attributesReferenceInfo

      protected boolean[] m_attributesReferenceInfo
    • m_attributesIsDynamicInfo

      protected boolean[] m_attributesIsDynamicInfo
    • m_attributesIsManagedViaAdapterBinding

      protected boolean[] m_attributesIsManagedViaAdapterBinding
    • m_styleValues

      protected Map<String,String> m_styleValues
    • m_attributesSetViaStyle

      protected Set<String> m_attributesSetViaStyle
    • m_explicitlyNulledAttributes

      protected Set<String> m_explicitlyNulledAttributes
  • Constructor Details

    • BaseComponent

      public BaseComponent()
  • Method Details

    • saveState

      public Object saveState(javax.faces.context.FacesContext context)
      Specified by:
      saveState in interface javax.faces.component.StateHolder
      Overrides:
      saveState in class javax.faces.component.UIComponentBase
    • restoreState

      public void restoreState(javax.faces.context.FacesContext context, Object state)
      Specified by:
      restoreState in interface javax.faces.component.StateHolder
      Overrides:
      restoreState in class javax.faces.component.UIComponentBase
    • m_componentRepository

      protected ComponentRepository m_componentRepository()
    • initWithWritingXMLDuringEncode

      public void initWithWritingXMLDuringEncode(boolean withWritingOwnXML)
    • initWithUpdatingPreviousDumpDuringEncode

      public void initWithUpdatingPreviousDumpDuringEncode(boolean value)
    • getTagNameWithPrefix

      public String getTagNameWithPrefix()
      Specified by:
      getTagNameWithPrefix in interface IBaseComponent
    • getTagName

      public String getTagName()
    • getTagPrefix

      public String getTagPrefix()
    • getPropertiesUsed

      public List<String> getPropertiesUsed()
    • checkIfAttributeIsExplicitlyNulled

      public boolean checkIfAttributeIsExplicitlyNulled(String attribute)
    • getAttributesSetViaStyle

      public Set<String> getAttributesSetViaStyle()
    • getClientTagName

      public String getClientTagName()
    • getAdapterBindingAterEncodeBegin

      public IComponentAdapterBinding getAdapterBindingAterEncodeBegin()
    • getMustNotBeUsedForEncodeDecode

      public boolean getMustNotBeUsedForEncodeDecode()
      The component is part of the component tree, but must not be used for encode/decode purposes. Example: PANE that is used with EXITID is cloned at runtime, the original components must not be used anymore.
    • setMustNotBeUsedForEncodeDecode

      public void setMustNotBeUsedForEncodeDecode(boolean mustNotBeUsedForEncodeDecode)
    • getOriginalAttributeString

      public String getOriginalAttributeString(String name)
      Returns the original attribute string that is defined in the corresponding jsp page. Due to content replacement the attribute string value for an expression may be quite different at runtime, than it is defined in the jsp page. This method passes back the expression string, as defined originally.
    • registerInnerEvent

      public void registerInnerEvent(String requestId)
      Any event is "registered" on the level, where it occurs - and delegated to the next level.
    • getInnerEventRequestId

      public String getInnerEventRequestId()
      This is the requet id of the last request that either manipulated data or called an action listener within this component.
    • setApplicationReference

      public void setApplicationReference(Object value)
      A component can get an application reference which is typically used in the case of using component binding with a managed bean - and here especially when used inside grid processing.
    • getApplicationReference

      public Object getApplicationReference()
    • getRendersChildren

      public boolean getRendersChildren()
      Overrides:
      getRendersChildren in class javax.faces.component.UIComponentBase
    • setRendersChildren

      public void setRendersChildren(boolean value)
    • setRendered

      public void setRendered(boolean rendered)
      Overrides:
      setRendered in class javax.faces.component.UIComponentBase
    • getFamily

      public String getFamily()
      Specified by:
      getFamily in class javax.faces.component.UIComponent
    • passPropertyUsage

      public void passPropertyUsage(Set<String> propertiesExplicitlySet, List<String> propertiesUsed, List<String> propertiesFix, List<String> propertiesExpression, Map<String,String> originalAttributes, Set<String> explicitlyNulledAttributes)
      With this method the BaseComponentTag object passes information which properties are used in which way.
      Parameters:
      propertiesUsed - All the properties that are used.
      propertiesFix - All properties with fix value definitions
      propertiesExpression - All properties with expression value definitions
      explicitlyNulledAttributes - Attributes containing a "null!" content
    • resetPreviousDump

      public void resetPreviousDump()
    • encodeBegin

      public void encodeBegin(javax.faces.context.FacesContext context) throws IOException
      Overrides:
      encodeBegin in class javax.faces.component.UIComponentBase
      Throws:
      IOException
    • indicateEncodeBeginWithClearedDump

      protected void indicateEncodeBeginWithClearedDump()
    • updateEncodeCounter

      protected int updateEncodeCounter()
      Counter that is counted up per roundtrip processing. Required to make sure that certain functions are only processed once per encode processing.
    • getEncodeCounter

      protected int getEncodeCounter()
    • encodeBeginWriteXML

      protected void encodeBeginWriteXML(javax.faces.context.FacesContext context, boolean buildUpNattsForced, ComponentDump currentDump) throws IOException
      Actually write the XML statements for the component. This method is only called if the component is directly written into the XML response (which is the default, but needs not to happen always: e.g. FIXGRID).
      Throws:
      IOException
    • encodeEnd

      public void encodeEnd(javax.faces.context.FacesContext context) throws IOException
      Overrides:
      encodeEnd in class javax.faces.component.UIComponentBase
      Throws:
      IOException
    • detectChangesInSubComponents

      protected void detectChangesInSubComponents(Writer writer, ComponentDump cd)
      This methods checks if there was any change below the component that makes it necessary to mark this component as changed within the XML output. For this purpose every sub-component holds a sequence counter: if not rendered then this sequence counter is set to "-1" if rendered then the first component has sequence counter 0, the next one 1, etc.
    • encodeChildren

      public void encodeChildren(javax.faces.context.FacesContext context) throws IOException
      Overrides:
      encodeChildren in class javax.faces.component.UIComponentBase
      Throws:
      IOException
    • getParameterNameForDecode

      protected String getParameterNameForDecode(javax.faces.context.FacesContext context)
      Returns the name of the parameter that is used for decoding the request's data. Typically is the clientid, but some controls (HTRADIOBUTTON...) define it in a different way.
    • appendDecodeInformation

      protected void appendDecodeInformation(List<BaseComponent.DecodePassData> decodeInfos)
      Components can add own values to be transferred within the decode phase.
    • processDecodes

      public void processDecodes(javax.faces.context.FacesContext context)
      Overrides:
      processDecodes in class javax.faces.component.UIComponentBase
    • processValidators

      public void processValidators(javax.faces.context.FacesContext context)
      Overrides:
      processValidators in class javax.faces.component.UIComponentBase
    • decode

      public void decode(javax.faces.context.FacesContext context)
      Overrides:
      decode in class javax.faces.component.UIComponentBase
    • checkIfSetDefaultAttributeMayFail

      protected boolean checkIfSetDefaultAttributeMayFail(String defaultUpdateAttribute)
    • setDecodeValueInValueBinding

      protected void setDecodeValueInValueBinding(javax.faces.context.FacesContext context, Object vb, String value, boolean flagSetMayFail)
    • getTagAttributes

      public List<String> getTagAttributes()
      Returns a list of all attributes that could potencially be maintained with this component.
    • addValueBindingExec

      protected void addValueBindingExec(javax.faces.context.FacesContext context, Object vb, Object value, boolean flagSetMayFail)
      Add value binding that is executed in the apply values phase.
    • addValueExpressionExec

      protected void addValueExpressionExec(org.eclnt.jsfserver.elements.BaseComponent.SetValueExec vbe)
      Add value binding that is executed in the apply values phase.
    • setParent

      public void setParent(javax.faces.component.UIComponent parent)
      Overrides:
      setParent in class javax.faces.component.UIComponentBase
    • destroy

      protected void destroy()
    • isDestroyed

      protected boolean isDestroyed()
    • processUpdates

      public void processUpdates(javax.faces.context.FacesContext context)
      Overrides:
      processUpdates in class javax.faces.component.UIComponentBase
    • setAttributeValueFromOutside

      public void setAttributeValueFromOutside(String attributeName, Object attributeValue)
      If directly manipulating attribute values of a component...: this is the (only!) way to do it!
    • resetInternalAttributeBuffer

      public final void resetInternalAttributeBuffer()
    • renderComponentNoChange

      public void renderComponentNoChange(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, ComponentDump currentDump) throws IOException
      In case of using event isolation inside ROWINCLUDE components may be rendered in a way, so that the client directly sees that there was no change within the component.
      This method needs to be overridden, if a component does not directly render itself into corresponding GUI components.
      Throws:
      IOException
    • convertValueDuringDecode

      protected String convertValueDuringDecode(String attribute, String value)
      Gives implementations the chance to convert an incoming value to specific needs.
    • getAttributeValueAsString

      public String getAttributeValueAsString(String attribute)
      Specified by:
      getAttributeValueAsString in interface IBaseComponent
    • readTagAttributesSet

      protected Set<String> readTagAttributesSet()
    • readTagAttributes

      protected List<String> readTagAttributes()
    • readDefaultUpdateAttribute

      protected String readDefaultUpdateAttribute()
    • reactOnSetPropertiesByTagFinished

      public void reactOnSetPropertiesByTagFinished()
    • updateComponentBinding

      protected void updateComponentBinding(javax.faces.context.FacesContext context)
      done with every request
    • checkIfToTakeOverAttribute

      protected boolean checkIfToTakeOverAttribute(String attributeName)
      In the decode phase the implementation takes over all attributes defined in the JSP file into the generated page. By this method you may decide not to take over certain attributes.
      Parameters:
      attributeName -
      Returns:
      true ==> take over, false ==> do not take over
    • buildAttributesIsDynamicInfo

      protected void buildAttributesIsDynamicInfo(List<String> tagAttributes)
    • createSubId

      public String createSubId(String sub)
      Creates an id for components that are created within this component. The creation of an id in a proper way is important for allowing the layout editor to find an original id when clicking onto a component.
    • createSubId

      public String createSubId()
    • createNewIdCounter

      public int createNewIdCounter()
    • getAttributeString

      public String getAttributeString(String name)
      Specified by:
      getAttributeString in interface IBaseComponent
      Returns:
      The attribute as it is specified by the user: if the user defined an expression then the expression string is passed back, not the evaluated result of the expression.
    • getAttributeString

      public String getAttributeString(String name, Boolean viaAttributes)
    • checkIfAttributesIsManagedByExpression

      public boolean checkIfAttributesIsManagedByExpression(String name)
    • getChild

      public javax.faces.component.UIComponent getChild(int index)
      Convenience method to retrieve child - return null if index does not fit.
    • ensureChildrenAreCreatedUpdated

      protected void ensureChildrenAreCreatedUpdated(javax.faces.context.FacesContext context)
    • getChildrenIgnoringInterimComponents

      protected List<javax.faces.component.UIComponent> getChildrenIgnoringInterimComponents()
    • getParentIgnoringInterimComponents

      protected javax.faces.component.UIComponent getParentIgnoringInterimComponents()
    • readCurrentComponentDump

      protected ComponentDump readCurrentComponentDump(javax.faces.context.FacesContext context)
    • readPreviousComponentDump

      protected ComponentDump readPreviousComponentDump(javax.faces.context.FacesContext context)
    • getPreferredDataType

      protected Class getPreferredDataType()
      When passing a value into a value binding then by default the value binding is asked for its data type. In case of hash tables it may happen that the value binding returns null as data type, because the corresponding hash table is not yet filled. In this case this method is asked for a preferred data type. This implementation always passes back "String.class", implementations can override this method and pass a more adequate one.
    • updateAttributeValue

      protected void updateAttributeValue(javax.faces.context.FacesContext context, String attributeName, String value, Class preferredType, boolean inUpdatePhase, boolean flagSetMayFail)
      Helper method: either set the value binding or the attribute.
    • ensureSessionIsValid

      public static void ensureSessionIsValid(javax.servlet.http.HttpSession session)
    • resolveComponentValueAsString

      public String resolveComponentValueAsString(boolean convertHTML)
    • resolveComponentValueAsFormattedValue

      public FIXGRIDBinding.FormattedValue resolveComponentValueAsFormattedValue()
    • getAttributeValue

      public final Object getAttributeValue(String attribute)
      Same method as getAttributesGet(String) - but with a nicer name...
      Specified by:
      getAttributeValue in interface IBaseComponent
    • getAttributesGet

      public final Object getAttributesGet(String attribute)
      Central method for getting value of an attribute.
      Parameters:
      viaAttributes - false => default - the attribute value is either directly defined or the attribute value has a corresponding value expression.
    • getAttributesGet

      public Object getAttributesGet(String attribute, boolean viaAttributes)
      Central method for getting value of an attribute.
      Parameters:
      viaAttributes - true => default - the attribute value is either directly defined or the attribute value has a corresponding value expression.
      false => read the attribute via adapter binding
    • getAttributesGetDirectFixStringValueOnly

      protected String getAttributesGetDirectFixStringValueOnly(String attribute)
    • retrieveNullValueFromComponent

      protected Object retrieveNullValueFromComponent(String attribute)
      The component may have some special rules for passing the value. Example: FIELD-TEXTELECTIONINFO.
      Returns:
      Default: null - this means everything processed as normal
    • convertValueDuringGetAttribute

      protected Object convertValueDuringGetAttribute(String attribute, Object value)
      Possibility to override and change the value.
    • getAttributeFromAdapterBinding

      public Object getAttributeFromAdapterBinding(String attribute)
    • getAttributeFromAdapterBinding

      public Object getAttributeFromAdapterBinding(IComponentAdapterBinding adapterBinding, String attribute)
      Central method for receiving value from component adapter binding
      Parameters:
      attributeName -
      Returns:
    • getExpressionFromComponentAttribute

      public Object getExpressionFromComponentAttribute(String attributeName)
      Returns the expression object (binding object! - not the expression string!!!) of the attribute.
    • setExpressionAsComponentAttributeFromOutside

      public void setExpressionAsComponentAttributeFromOutside(String attributeName, Object expressionObject)
    • readAttributeValueDuringEncodeFromAttributesOrFromAdapterBinding

      protected Object readAttributeValueDuringEncodeFromAttributesOrFromAdapterBinding(String attributeName)
    • isRendered

      public boolean isRendered()
      Overrides:
      isRendered in class javax.faces.component.UIComponentBase
    • checkIfToBeConsideredForCascadeRenderedFalse

      protected boolean checkIfToBeConsideredForCascadeRenderedFalse()
    • getSavedState

      protected Object getSavedState(javax.faces.context.FacesContext context, BaseComponent bc)
    • findCurrentDump

      protected final ComponentDump findCurrentDump(javax.faces.context.FacesContext context)
    • findContentReplaceListDuringRendering

      protected List<ValueManager.NameValue> findContentReplaceListDuringRendering(boolean includeDrillDownReplacements, boolean withGridContentReplace)
      This method returns the current content replacement list that is built up during the recursive rendering of controls during the rendering phase.

      If only returns valid results if being called in this phase!

      The result can be passed into newly created components, in order to update their expressions, see: {@link BaseComponentTag#defineContentReplacements(List).
    • junit_buildContentRepleaceString

      public static List<ValueManager.NameValue> junit_buildContentRepleaceString(String contentReplaceGrid, String contentReplace, String contentReplaceDrillDown)
    • junit_removeDoubleReplacements

      public static void junit_removeDoubleReplacements(List<ValueManager.NameValue> replacements)
    • queueEvent

      public final void queueEvent(javax.faces.event.FacesEvent event)
      Overrides:
      queueEvent in class javax.faces.component.UIComponentBase
    • queueEventExecute

      protected final void queueEventExecute(javax.faces.event.FacesEvent event)
    • applyChangedStyleVariant

      protected boolean applyChangedStyleVariant(int encodeCounter)
    • checkIfComponentHasAdapterBinding

      protected boolean checkIfComponentHasAdapterBinding()
      Check if component has adapter binding.
    • getComponentAdapterBinding

      protected IComponentAdapterBinding getComponentAdapterBinding()
      Access component adapter binding.
    • checkComponentAdapterBinding

      protected void checkComponentAdapterBinding(IComponentAdapterBinding o)
      Some components (e.g. FIXGRID) require a special interface extending IComponentAdapterBinding. Here they can check...
    • getComponentClass

      protected Class getComponentClass()
      Returns:
      This the class for internally accessing all the meta data for the component. In case of SC_* components the result is different to the own class.
    • checkIfComponentTagIsAvailable

      public boolean checkIfComponentTagIsAvailable()
      Returns:
      Definition if a tag class is available for this component. By default this is true, for special types of components (SC_*) this is not true.
    • checkIfEncodeCalledFirstTime

      public boolean checkIfEncodeCalledFirstTime()
    • checkIfStyleVariantIsDynamic

      protected boolean checkIfStyleVariantIsDynamic()
    • setCurrentComponentDump

      protected void setCurrentComponentDump(ComponentDump cd)
      Used of for special inheriting classes (e.g. grid).
    • executeQueueingOfBufferedEvents

      protected void executeQueueingOfBufferedEvents()
      Called by PAGEADDONS / HTPAGEADDONS2 component at end of page processing. The events are now transferred to the "real" event processing of JSF. Before they are sorted by priority.
    • checkIfComponentIdIsPartOfRequest

      protected boolean checkIfComponentIdIsPartOfRequest(String clientId)
    • clearAndDestroyChildren

      public void clearAndDestroyChildren()
    • findIdOfNextROWINCLUDEComponentAbove

      protected String findIdOfNextROWINCLUDEComponentAbove()
      Utility function: finds id of the next ROWINCLUDE component above this component. Returns "TOP" if there is no component on top.
    • findPageNameOfNextROWINCLUDEComponentAbove

      protected String findPageNameOfNextROWINCLUDEComponentAbove()
      Utility function: finds id of the next ROWINCLUDE component above this component. Returns "" if there is no component on top.