Class Bindings


  • public class Bindings
    extends java.lang.Object
    A singleton container class for all the bindings defined in the application. These
    bindings are defined in static XML files under "/WEB-INF/bcdui/bindings" and read
    as soon as the first access to the getInstance method occurs. In non-debug mode
    the bindings are cached so that the files are read only once.
    Don't use de.businesscode.bcdui.toolbox.Configuration instance here to avoid cyclic dependencies (Configuration itself uses Bindings to get parameters from database, etc), Instead use the static BareConfiguration.getInstance() to read static configuration
    • Field Detail

      • bindings

        protected static Bindings bindings
      • warBindingMap

        protected java.util.Map<java.lang.String,​java.util.Collection<StandardBindingSet>> warBindingMap
      • escapeXmlAttributeName

        public static final java.lang.String escapeXmlAttributeName
        See Also:
        Constant Field Values
      • keyAttributeName

        public static final java.lang.String keyAttributeName
        See Also:
        Constant Field Values
      • jdbcDataTypeCodeAttribute

        public static final java.lang.String jdbcDataTypeCodeAttribute
        See Also:
        Constant Field Values
      • jdbcDataTypeNameAttribute

        public static final java.lang.String jdbcDataTypeNameAttribute
        See Also:
        Constant Field Values
      • jdbcColumnDisplaySizeAttribute

        public static final java.lang.String jdbcColumnDisplaySizeAttribute
        See Also:
        Constant Field Values
      • jdbcColumnScaleAttribute

        public static final java.lang.String jdbcColumnScaleAttribute
        See Also:
        Constant Field Values
      • jdbcSignedAttribute

        public static final java.lang.String jdbcSignedAttribute
        See Also:
        Constant Field Values
      • jdbcNullableAttribute

        public static final java.lang.String jdbcNullableAttribute
        See Also:
        Constant Field Values
      • readOnlyAttributeName

        public static final java.lang.String readOnlyAttributeName
        See Also:
        Constant Field Values
    • Method Detail

      • isInitialized

        public static boolean isInitialized()
        a special method for internal usage to resolve cyclic dependencies, if your class is using Bindings (i.e. to write to database) and the Binding itself directly or transitively depends on your class. If this method returns FALSE, then calling getInstance() will end-up in a dead-lock in case your class is also used during Binding initialization process.
        Returns:
      • getInstance

        public static Bindings getInstance()
                                    throws BindingException
        to use the method - Bindings must be first loaded by calling getInstance(String directory) or getInstance(HttpServletRequest request). Method getInstance
        Returns:
        Throws:
        BindingException
      • getBindingSetUnchecked

        protected java.util.Collection<StandardBindingSet> getBindingSetUnchecked​(java.lang.String bindingSetId)
        Allows overwriting if there are multiple sources for BindingSets
        Parameters:
        bindingSetId -
        Returns:
      • get

        @Deprecated
        public StandardBindingSet get​(java.lang.String bindingSetId)
                               throws BindingException
        Deprecated.
        This getter is deprecated because it prevents the BindingSetGroup feature from being totally transparent to the user.
        Fetches the specified BindingSet. This method does not work with BindingSetGroups therefore it should not be used anymore.
        Parameters:
        bindingSetId - The id of the BindingSet to be returned.
        Returns:
        The BindingSet registered under the id.
        Throws:
        BindingException
      • hasBindingSet

        public boolean hasBindingSet​(java.lang.String bindingSetId)
        tells silently if one or more BindingSet exists, this method can be used for classes which feature availability depends on a Binding.
        Parameters:
        bindingSetId -
        Returns:
        true if at least one binding-set exists which such name, false otherwise.
      • get

        public StandardBindingSet get​(java.lang.String bindingSetId,
                                      java.util.Collection<java.lang.String> items)
                               throws BindingException
        EnterpriseEdition allows us to search for a "best-match" BindingSet here, which allows for deep optimizations at runtime
        Parameters:
        bindingSetId -
        items -
        Returns:
        Throws:
        BindingException
      • clear

        public static void clear()
        clears the bindings so that getInstance() would return a new instance, reading BindingSets fresh
      • getWrqModifiers

        public java.util.List<java.lang.Class<? extends Modifier>> getWrqModifiers​(java.lang.String bindingSetId)
                                                                            throws BindingException
        Potential extension point
        Throws:
        BindingException