Package de.businesscode.bcdui.binding
Class Bindings
- java.lang.Object
-
- de.businesscode.bcdui.binding.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 Summary
Fields Modifier and Type Field Description static java.lang.String
aggrAttribute
protected static Bindings
bindings
static java.lang.String
escapeXmlAttributeName
static java.lang.String
jdbcColumnDisplaySizeAttribute
static java.lang.String
jdbcColumnScaleAttribute
static java.lang.String
jdbcDataTypeCodeAttribute
static java.lang.String
jdbcDataTypeNameAttribute
static java.lang.String
jdbcNullableAttribute
static java.lang.String
jdbcSignedAttribute
static java.lang.String
keyAttributeName
protected static int
MAX_PARALLEL_THREADS
protected static int
MAX_WAIT_MINS
static java.lang.String
readOnlyAttributeName
protected java.util.Map<java.lang.String,java.util.Collection<StandardBindingSet>>
warBindingMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
Bindings()
Bindings
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
clear()
clears the bindings so that getInstance() would return a new instance, reading BindingSets freshStandardBindingSet
get(java.lang.String bindingSetId)
Deprecated.This getter is deprecated because it prevents the BindingSetGroup feature from being totally transparent to the user.StandardBindingSet
get(java.lang.String bindingSetId, java.util.Collection<java.lang.String> items)
EnterpriseEdition allows us to search for a "best-match" BindingSet here, which allows for deep optimizations at runtimeprotected java.util.Collection<StandardBindingSet>
getBindingSetUnchecked(java.lang.String bindingSetId)
Allows overwriting if there are multiple sources for BindingSetsstatic Bindings
getInstance()
to use the method - Bindings must be first loaded by calling getInstance(String directory) or getInstance(HttpServletRequest request).java.util.List<java.lang.Class<? extends Modifier>>
getWrqModifiers(java.lang.String bindingSetId)
Potential extension pointboolean
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.protected void
initWarMap()
/* EnterpriseEdition has a more powerful BindingSet readerstatic 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.void
readAdditionalBindings()
Optional extension pointprotected java.util.Map<java.lang.String,java.util.Collection<StandardBindingSet>>
readBindings(java.lang.Class<? extends ReadBindingSet> rbs)
Start of folder recursionvoid
readDependentBindings()
Optional extension point
-
-
-
Field Detail
-
MAX_PARALLEL_THREADS
protected static final int MAX_PARALLEL_THREADS
- See Also:
- Constant Field Values
-
MAX_WAIT_MINS
protected static final int MAX_WAIT_MINS
- See Also:
- Constant Field Values
-
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
-
aggrAttribute
public static final java.lang.String aggrAttribute
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Bindings
protected Bindings() throws BindingException
Bindings- Throws:
BindingException
-
-
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 callinggetInstance()
will end-up in a dead-lock in case your class is also used during Binding initialization process.- Returns:
-
initWarMap
protected void initWarMap() throws BindingException
/* EnterpriseEdition has a more powerful BindingSet reader- Throws:
BindingException
-
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
-
readBindings
protected java.util.Map<java.lang.String,java.util.Collection<StandardBindingSet>> readBindings(java.lang.Class<? extends ReadBindingSet> rbs) throws BindingException
Start of folder recursion- Parameters:
rbs
-- 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
-
readDependentBindings
public void readDependentBindings() throws BindingException
Optional extension point- Throws:
BindingException
-
readAdditionalBindings
public void readAdditionalBindings() throws BindingException
Optional extension point- Throws:
BindingException
-
-