Class TagEncodingHelper

java.lang.Object
org.apache.empire.jsf2.utils.TagEncodingHelper
All Implemented Interfaces:
javax.faces.component.NamingContainer

public class TagEncodingHelper extends Object implements javax.faces.component.NamingContainer
TagEncodingHelper Used by all Empire Components to exchange data and render
  • Field Details

    • COMPONENT_FAMILY

      public static final String COMPONENT_FAMILY
      See Also:
    • FACES_ID_PREFIX

      public static final String FACES_ID_PREFIX
      See Also:
    • CSS_STYLE_USE_INPUT_TYPE_INSTEAD_OF_DATA_TYPE

      public static boolean CSS_STYLE_USE_INPUT_TYPE_INSTEAD_OF_DATA_TYPE
    • ORIGINAL_COMPONENT_ID

      public static final String ORIGINAL_COMPONENT_ID
      See Also:
    • COLATTR_TOOLTIP

      public static final String COLATTR_TOOLTIP
      See Also:
    • COLATTR_ABBR_TITLE

      public static final String COLATTR_ABBR_TITLE
      See Also:
    • component

      protected final javax.faces.component.UIOutput component
    • cssStyleClass

      protected final String cssStyleClass
    • column

      protected Column column
    • record

      protected Object record
    • recordTag

      protected RecordTag recordTag
    • uiDataTag

      protected javax.faces.component.UIData uiDataTag
    • formGridTag

      protected FormGridTag formGridTag
    • control

      protected InputControl control
    • textResolver

      protected TextResolver textResolver
    • hasValueExpr

      protected byte hasValueExpr
    • insideUIData

      protected byte insideUIData
    • readOnly

      protected byte readOnly
    • valueRequired

      protected byte valueRequired
    • optionsDetected

      protected boolean optionsDetected
    • options

      protected Options options
    • valueInfo

      protected InputControl.ValueInfo valueInfo
    • skipValidation

      protected boolean skipValidation
    • mostRecentValue

      protected Object mostRecentValue
    • PH_COLUMN_NAME

      public static final char PH_COLUMN_NAME
      See Also:
    • PH_COLUMN_FULL

      public static final char PH_COLUMN_FULL
      See Also:
    • PH_COLUMN_SMART

      public static final char PH_COLUMN_SMART
      See Also:
    • ALLOWED_COLUMN_PH

      public static final char[] ALLOWED_COLUMN_PH
    • SMART_COLUMN_NAME_SET

      public static final Set<String> SMART_COLUMN_NAME_SET
    • CC_ATTR_EXPR

      protected static final String CC_ATTR_EXPR
      See Also:
    • TAGLIB_ATTR_PREFIX

      protected static String TAGLIB_ATTR_PREFIX
    • CSS_DATA_TYPE_NONE

      public static final String CSS_DATA_TYPE_NONE
    • CSS_DATA_TYPE_INT

      public static final String CSS_DATA_TYPE_INT
      See Also:
    • CSS_DATA_TYPE_NUMBER

      public static final String CSS_DATA_TYPE_NUMBER
      See Also:
    • CSS_DATA_TYPE_TEXT

      public static final String CSS_DATA_TYPE_TEXT
      See Also:
    • CSS_DATA_TYPE_LONGTEXT

      public static final String CSS_DATA_TYPE_LONGTEXT
      See Also:
    • CSS_DATA_TYPE_DATE

      public static final String CSS_DATA_TYPE_DATE
      See Also:
    • CSS_DATA_TYPE_DATETIME

      public static final String CSS_DATA_TYPE_DATETIME
      See Also:
    • CSS_DATA_TYPE_BOOL

      public static final String CSS_DATA_TYPE_BOOL
      See Also:
  • Constructor Details

    • TagEncodingHelper

      protected TagEncodingHelper(javax.faces.component.UIOutput component, String cssStyleClass)
      Constructor
      Parameters:
      component - the UIComponent
      cssStyleClass - the basic cssStyleClass
  • Method Details

    • encodeBegin

      public void encodeBegin()
      Called from UIComponent.encodeBegin()
    • prepareData

      public void prepareData()
      Prepares the control for decoding, validating and updating
    • completeInputTagId

      public String completeInputTagId(String id)
    • getInputControl

      public InputControl getInputControl()
    • detectInputControl

      protected InputControl detectInputControl(String controlType, DataType dataType)
    • checkRecord

      protected void checkRecord()
    • getValueInfo

      public InputControl.ValueInfo getValueInfo(javax.faces.context.FacesContext ctx)
    • getInputInfo

      public InputControl.InputInfo getInputInfo(javax.faces.context.FacesContext ctx)
    • isSkipValidation

      public boolean isSkipValidation()
    • hasColumn

      public boolean hasColumn()
    • getColumn

      public Column getColumn()
    • getColumnName

      public String getColumnName()
    • getColumnFullName

      public String getColumnFullName()
    • getColumnSmartName

      public String getColumnSmartName()
    • setColumn

      public void setColumn(Column column)
    • getRecord

      public Object getRecord()
    • setRecord

      public void setRecord(Object record)
    • reset

      public void reset()
    • resetColumn

      public void resetColumn()
    • findRecordComponent

      public Object findRecordComponent()
    • isDetectFieldChange

      protected boolean isDetectFieldChange()
    • getDataValue

      public Object getDataValue(boolean evalExpression)
    • setDataValue

      public void setDataValue(Object value)
    • isRenderValueComponent

      public boolean isRenderValueComponent()
    • isRecordReadOnly

      public boolean isRecordReadOnly()
    • getRecordReadOnly

      public Boolean getRecordReadOnly()
    • isVisible

      public boolean isVisible()
    • isReadOnly

      public final boolean isReadOnly()
    • detectReadOnly

      protected boolean detectReadOnly()
    • isValueRequired

      public final boolean isValueRequired()
    • detectValueRequired

      protected boolean detectValueRequired()
    • isDisabled

      public final boolean isDisabled()
    • getDisabled

      public InputControl.DisabledType getDisabled()
    • isValueModified

      public boolean isValueModified()
    • validateNullValue

      public boolean validateNullValue()
    • beginValidateValue

      public boolean beginValidateValue(javax.faces.context.FacesContext ctx, Object value)
    • beginUpdateModel

      public boolean beginUpdateModel(javax.faces.context.FacesContext ctx, Object value)
    • findColumn

      protected Column findColumn()
    • findColumnFromValue

      protected Column findColumnFromValue()
      Checks whether the value attribute contains a column reference and returns it
      Returns:
      the column
    • createColumnExprWrapper

      protected Column createColumnExprWrapper(ColumnExpr colExpr)
    • unwrapColumnExpr

      protected ColumnExpr unwrapColumnExpr(Column col)
    • unwrapColumn

      protected Column unwrapColumn(Column col)
    • findRecord

      protected Object findRecord()
    • getValueExpression

      protected javax.el.ValueExpression getValueExpression()
    • hasValueExpression

      protected boolean hasValueExpression()
    • findTopValueExpression

      protected javax.el.ValueExpression findTopValueExpression(String attribute)
    • getBeanPropertyValue

      protected Object getBeanPropertyValue(Object bean, String property)
    • setBeanPropertyValue

      protected void setBeanPropertyValue(Object bean, String property, Object value)
    • getValueOptions

      protected final Options getValueOptions()
    • detectValueOptions

      protected Options detectValueOptions()
    • getValueTooltip

      public String getValueTooltip(Object value)
    • getLabelTooltip

      public String getLabelTooltip(Column column)
    • hasFormat

      public boolean hasFormat(String format)
    • hasFormat

      public boolean hasFormat(InputControl.ValueInfo vi, String format)
    • getDisplayText

      public String getDisplayText(Column column, Object value)
    • getDisplayText

      public final String getDisplayText(Object value)
    • getTextResolver

      public TextResolver getTextResolver(javax.faces.context.FacesContext context)
    • getLocale

      public Locale getLocale()
    • detectError

      protected boolean detectError(javax.faces.context.FacesContext context)
    • getFieldValueErrorMessage

      public javax.faces.application.FacesMessage getFieldValueErrorMessage(javax.faces.context.FacesContext context, Exception e, Object value)
    • addFieldValueErrorMessage

      public void addFieldValueErrorMessage(javax.faces.context.FacesContext context, Exception e, Object value)
    • getFormGrid

      protected FormGridTag getFormGrid()
    • getControlRenderInfo

      public ControlRenderInfo getControlRenderInfo()
    • getAutoControlId

      public String getAutoControlId()
    • getControlExtraLabelWrapperStyle

      public String getControlExtraLabelWrapperStyle()
    • getControlExtraInputWrapperStyle

      public String getControlExtraInputWrapperStyle()
    • isControlTagElementValid

      protected boolean isControlTagElementValid()
      Returns whether a control element is rendered Use to detect legacy behavior with no separate control element and only two <td> for label and input wrapper
      Returns:
      true if a control element is rendered or false in legacy case
    • getLabelValue

      protected String getLabelValue(Column column, boolean colon)
    • createLabelComponent

      public javax.faces.component.html.HtmlOutputLabel createLabelComponent(javax.faces.context.FacesContext context, String forInput, StyleClass styleClass, String style, boolean colon)
    • updateLabelComponent

      public void updateLabelComponent(javax.faces.context.FacesContext context, javax.faces.component.html.HtmlOutputLabel label, String forInput)
    • completeLabelStyleClass

      protected String completeLabelStyleClass(String styleClasses, boolean required)
    • addRequiredMark

      protected void addRequiredMark(javax.faces.component.html.HtmlOutputLabel label)
    • getDataTypeClass

      @Deprecated protected String getDataTypeClass(DataType type)
      Deprecated.
    • getSimpleStyleClass

      public StyleClass getSimpleStyleClass(String userStyle)
    • getSimpleStyleClass

      public StyleClass getSimpleStyleClass()
    • getTagStyleClass

      public StyleClass getTagStyleClass(String typeClass, String userStyle)
    • getTagStyleClass

      public StyleClass getTagStyleClass(String typeClass)
    • getTagStyleClass

      public StyleClass getTagStyleClass()
    • getContextStyleClass

      public String getContextStyleClass()
    • detectInsideUIData

      protected boolean detectInsideUIData()
    • isInsideUIData

      public final boolean isInsideUIData()
    • buildComponentId

      public static String buildComponentId(String s)
    • hasComponentId

      public static boolean hasComponentId(javax.faces.component.UIComponent component)
    • hasComponentId

      public boolean hasComponentId()
    • saveComponentId

      public void saveComponentId(javax.faces.component.UIComponent comp)
    • restoreComponentId

      public void restoreComponentId(javax.faces.component.UIComponent comp)
    • resetComponentId

      public void resetComponentId(javax.faces.component.UIComponent comp)
    • getColumnAttribute

      public Object getColumnAttribute(String name)
    • getColumnAttributeString

      public String getColumnAttributeString(String name)
    • getTagAttributeValue

      public Object getTagAttributeValue(String name)
    • getTagAttributeString

      public String getTagAttributeString(String name, String defValue)
    • getTagAttributeString

      public String getTagAttributeString(String name)
    • getTagAttributeValueEx

      public Object getTagAttributeValueEx(String name, boolean isCssStyleClass)
    • getTagAttributeStringEx

      public String getTagAttributeStringEx(String name, boolean isCssStyleClass)
    • writeComponentId

      public void writeComponentId(javax.faces.context.ResponseWriter writer, boolean renderAutoId) throws IOException
      Throws:
      IOException
    • writeComponentId

      public void writeComponentId(javax.faces.context.ResponseWriter writer) throws IOException
      Throws:
      IOException
    • writeAttribute

      public void writeAttribute(javax.faces.context.ResponseWriter writer, String attribute, Object value) throws IOException
      Throws:
      IOException
    • writeStyleClass

      public void writeStyleClass(javax.faces.context.ResponseWriter writer, String... styleClasses) throws IOException
      Throws:
      IOException
    • writeStyleClass

      public void writeStyleClass(javax.faces.context.ResponseWriter writer) throws IOException
      Throws:
      IOException
    • writeWrapperTag

      public String writeWrapperTag(javax.faces.context.FacesContext context, boolean renderId, boolean renderValue) throws IOException
      Writes a wrapper tag for e:value and e:input Hint: For e:control the input separator tag acts as the wrapper
      Parameters:
      context - the faces context
      renderId - flag whether or not to render the components client id
      renderValue - flag whether to render and input wrapper (false) or a value wrapper (true)
      Returns:
      the tag name of the wrapper tag
      Throws:
      IOException - from ResponseWriter