Package com.microstrategy.web.transform
Class StyleMapImpl
- java.lang.Object
-
- com.microstrategy.utils.config.AbstractConfigurationElement
-
- com.microstrategy.web.transform.AbstractStyleCatalogElement
-
- com.microstrategy.web.transform.StyleMapImpl
-
- All Implemented Interfaces:
ConfigurationElement
,ConfigurationFile
,StyleMap
,java.lang.Cloneable
public class StyleMapImpl extends AbstractStyleCatalogElement implements StyleMap
This class implements theStyleMap
interface for the Style Catalog.- Since:
- MicroStrategy Web 9.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTR_NAME_STYLEMAP_FROM_STYLE
The name of the style map "from style" attribute.static java.lang.String
ELEM_NAME_STYLEMAP
The name of the style map element.-
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description StyleMapImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clear()
Clears the collection of style map clause objects.int
getCount()
Returns the number ofStyleMapClause
objects in this collection.protected java.lang.String
getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.StyleMapClause
getStyleMapClause(int index)
Gets theStyleMapClause
associated with supplied index.java.lang.String
getStyleName()
Returns the style name that this map exists for.java.lang.String
mapStyle(java.lang.String origStyleName, StyleRequestContext context)
Maps the original style name to a new one, based on the "style map clauses" contained in this map along with any contextual data.StyleMapCondition
newStyleMapCondition(java.lang.String toStyle)
Deprecated.StyleMapCondition
newStyleMapCondition(java.lang.String toStyle, java.lang.String mapperDefn, java.lang.String addlData)
Creates a new style map condition object that, if the conditions were satisfied, would map the style to the specified name.void
remove(int index)
Removes theStyleMapClause
object at the specified index.StyleMapDefault
setStyleMapDefault(java.lang.String toStyle)
Creates a new style map default object that maps the style to the specified name.void
setStyleName(java.lang.String styleName)
Sets the style name that this map exists for.-
Methods inherited from class com.microstrategy.web.transform.AbstractStyleCatalogElement
clearCaches, copyContents, getStyleCatalog, hasChanged, reload, resetChanged, setStrAttribute
-
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getDTDFileName, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getKey, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initDefaultAttributes, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, isKeyAttribute, load, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setKey, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.microstrategy.utils.config.ConfigurationElement
getAttribute, getAttributes, getElement, getElements, getKey, getNodeName, getStrAttribute, initFromXML, reload, toXML
-
-
-
-
Field Detail
-
ELEM_NAME_STYLEMAP
public static final java.lang.String ELEM_NAME_STYLEMAP
The name of the style map element.- See Also:
- Constant Field Values
-
ATTR_NAME_STYLEMAP_FROM_STYLE
public static final java.lang.String ATTR_NAME_STYLEMAP_FROM_STYLE
The name of the style map "from style" attribute.- See Also:
- Constant Field Values
-
-
Method Detail
-
getStyleName
public java.lang.String getStyleName()
Returns the style name that this map exists for.- Specified by:
getStyleName
in interfaceStyleMap
- Returns:
- The style name that this map exists for.
-
setStyleName
public void setStyleName(java.lang.String styleName)
Sets the style name that this map exists for.- Specified by:
setStyleName
in interfaceStyleMap
- Parameters:
styleName
- The name of the style that this map exists for.- Throws:
java.lang.IllegalArgumentException
- DOCUMENT ME!
-
getCount
public int getCount()
Returns the number ofStyleMapClause
objects in this collection.
-
getStyleMapClause
public StyleMapClause getStyleMapClause(int index) throws java.lang.IndexOutOfBoundsException
Gets theStyleMapClause
associated with supplied index. A valid index begins at 0 and continues togetCount() - 1
.- Specified by:
getStyleMapClause
in interfaceStyleMap
- Parameters:
index
- The index of theStyleMapClause
to return.- Returns:
- The
StyleMapClause
at the supplied index. - Throws:
java.lang.IndexOutOfBoundsException
- This exception is thown if the argument is outside the range of a valid index.
-
clear
public void clear() throws java.lang.UnsupportedOperationException
Description copied from interface:StyleMap
Clears the collection of style map clause objects.
-
remove
public void remove(int index) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
Removes theStyleMapClause
object at the specified index.- Specified by:
remove
in interfaceStyleMap
- Parameters:
index
- The index of the style map clause object to remove.- Throws:
java.lang.IndexOutOfBoundsException
- This exception is thown if the argument is outside the range of a valid index.java.lang.UnsupportedOperationException
- This exception is thrown if the Style Catalog is in "read only" mode.
-
newStyleMapCondition
public StyleMapCondition newStyleMapCondition(java.lang.String toStyle) throws java.lang.UnsupportedOperationException
Deprecated.Creates a new style map condition object that, if the conditions were satifisfied, would map the style to the specified name.- Specified by:
newStyleMapCondition
in interfaceStyleMap
- Parameters:
toStyle
- The name of the style to use if the conditions were met.- Returns:
- A new
StyleMapCondition
object. - Throws:
java.lang.UnsupportedOperationException
- This exception is thrown if the Style Catalog is in "read only" mode.
-
newStyleMapCondition
public StyleMapCondition newStyleMapCondition(java.lang.String toStyle, java.lang.String mapperDefn, java.lang.String addlData)
Creates a new style map condition object that, if the conditions were satisfied, would map the style to the specified name.- Parameters:
toStyle
- The name of the style to use if the conditions were met.mapperDefn
- The name of theMapperDefn
object associated with this mapping condition.addlData
- The additional data associated with this mapping condition.- Returns:
- A new
StyleMapCondition
object. - Since:
- MicroStrategy Web 9.0.1
-
setStyleMapDefault
public StyleMapDefault setStyleMapDefault(java.lang.String toStyle) throws java.lang.UnsupportedOperationException
Creates a new style map default object that maps the style to the specified name.- Specified by:
setStyleMapDefault
in interfaceStyleMap
- Parameters:
toStyle
- The name of the style to use.- Returns:
- A new
StyleMapDefault
object. - Throws:
java.lang.UnsupportedOperationException
- This exception is thrown if the Style Catalog is in "read only" mode.
-
mapStyle
public java.lang.String mapStyle(java.lang.String origStyleName, StyleRequestContext context)
Maps the original style name to a new one, based on the "style map clauses" contained in this map along with any contextual data.- Specified by:
mapStyle
in interfaceStyleMap
- Parameters:
origStyleName
- The original style name.context
- TheStyleRequestContext
object that contain context data.- Returns:
- The name of the new style name to use.
-
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElement
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.- Specified by:
getKeyAttribute
in classAbstractConfigurationElement
-
-