Class PreferenceDefinitionImpl
- java.lang.Object
-
- com.microstrategy.web.preferences.PreferenceDefinitionBase
-
- com.microstrategy.web.preferences.PreferenceDefinitionImpl
-
- All Implemented Interfaces:
PreferenceDefinition
- Direct Known Subclasses:
EmptyNumericStringPreferenceDefinition
,PreferenceDefinitionLocale
,PreferenceDefinitionMinMax
,PreferenceStartPageAllowableValue
,PreferenceValidationForDefaultLoginMode
,PreferenceValidationForMargins
,PreferenceValidationForPrintRowsColsPerPage
,PreferenceValidationForStartPage
,PreferenceValidationForStrings
public class PreferenceDefinitionImpl extends PreferenceDefinitionBase
This class encapsulates the definition of a preference. Most definitions will simply use this implementation as the default. Custom definitions may extend the PreferenceDefinitionBase directly, or make use of predefined overrides offered by this class. Subclasses that overridePreferenceDefinitionBase.setAttributes(Attributes, PreferenceLevels)
, andPreferenceDefinitionBase.buildXmlAttributes(XMLBuilder)
should make the appropriate super call back to this class to handle the base attributes.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
Att_Class
static java.lang.String
Att_ClusterPropagate
static java.lang.String
Att_DescriptionID
static java.lang.String
Att_Scope
static java.lang.String
Tag_AllowableValue
static java.lang.String
Tag_AllowableValues
-
Fields inherited from class com.microstrategy.web.preferences.PreferenceDefinitionBase
_allowableValues, _clusterPropagate, _description, _levels, _name, _scope, _type, _value
-
Fields inherited from interface com.microstrategy.web.preferences.PreferenceDefinition
TYPE_BOOLEAN, TYPE_DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PreferenceDefinitionImpl()
Constructor for creating PreferenceDefinition objects from XML parsing.protected
PreferenceDefinitionImpl(java.lang.String name, PreferenceLevels lvls)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
buildXmlAttributes(XMLBuilder builder)
Constructs an XML representation of the preference definition.protected void
setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group)
Populates the object with attributes from parsing the definition XML.protected void
setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group, boolean update)
Populates the object with attributes from parsing the definition XML.java.lang.String
toString()
protected void
validate(java.lang.String value, Preferences pref, java.lang.Object validationObject)
Deprecated.replaced byvalidateTransmute(String, Preferences, Object)
protected void
validateAllowableValues(java.lang.String value, Preferences pref, java.lang.Object validationObject)
protected java.lang.String
validateTransmute(java.lang.String value, Preferences pref, java.lang.Object validationObject)
This method is triggered by callback when setting preference values.-
Methods inherited from class com.microstrategy.web.preferences.PreferenceDefinitionBase
clusterPropagate, getAllowableValues, getDescription, getEnumPreferenceLevels, getName, getScope, getType, getValue, setClusterPropagate, setDescription, setEnumPreferenceLevels, setName, setScope, setType, setValue, validateDataType
-
-
-
-
Field Detail
-
Att_Scope
public static final java.lang.String Att_Scope
- See Also:
- Constant Field Values
-
Att_Class
public static final java.lang.String Att_Class
- See Also:
- Constant Field Values
-
Att_ClusterPropagate
public static final java.lang.String Att_ClusterPropagate
- Since:
- MicroStrategy Web 8.0.1
- See Also:
- Constant Field Values
-
Tag_AllowableValues
public static final java.lang.String Tag_AllowableValues
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
Tag_AllowableValue
public static final java.lang.String Tag_AllowableValue
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
Att_DescriptionID
public static final java.lang.String Att_DescriptionID
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PreferenceDefinitionImpl
protected PreferenceDefinitionImpl(java.lang.String name, PreferenceLevels lvls) throws MSTRUncheckedException
- Throws:
MSTRUncheckedException
-
PreferenceDefinitionImpl
protected PreferenceDefinitionImpl()
Constructor for creating PreferenceDefinition objects from XML parsing.
-
-
Method Detail
-
validate
protected void validate(java.lang.String value, Preferences pref, java.lang.Object validationObject) throws PreferencesException
Deprecated.replaced byvalidateTransmute(String, Preferences, Object)
This method is triggered by callback when setting preference values. By default, this method doesn't do anything.- Specified by:
validate
in classPreferenceDefinitionBase
- Throws:
PreferencesException
-
validateAllowableValues
protected void validateAllowableValues(java.lang.String value, Preferences pref, java.lang.Object validationObject) throws PreferencesException
- Throws:
PreferencesException
- Since:
- MicroStrategy Web 9.0.0
-
validateTransmute
protected java.lang.String validateTransmute(java.lang.String value, Preferences pref, java.lang.Object validationObject) throws PreferencesException
This method is triggered by callback when setting preference values. By default, this method doesn't do anything. The returned value will be used to set the preference value - this facilitates preprocessing such as trimming strings, or date time reformating.- Returns:
- transmuted preference value
- Throws:
PreferencesException
- Since:
- MicroStrategy Web 8.0.0
-
setAttributes
protected void setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group) throws PreferencesException
Populates the object with attributes from parsing the definition XML. The attributes populated by PreferenceDefinitionImpl are as follows: name, value, description, type, scope, and the preference levels grouping. This method will call the setAttributes method with the update as false- Specified by:
setAttributes
in classPreferenceDefinitionBase
- Parameters:
attrs
- properties of the definition in XML form.group
- used to check the scope of the definition.- Throws:
PreferencesException
- if errors occur during the population.- See Also:
PreferenceDefinitionBase.setAttributes(Attributes, PreferenceLevels)
-
setAttributes
protected void setAttributes(org.xml.sax.Attributes attrs, PreferenceLevels group, boolean update) throws PreferencesException
Populates the object with attributes from parsing the definition XML. The attributes populated by PreferenceDefinitionImpl are as follows: name, value, description, type, scope, and the preference levels grouping.- Specified by:
setAttributes
in classPreferenceDefinitionBase
- Parameters:
attrs
- properties of the definition in XML form.group
- used to check the scope of the definition.- Throws:
PreferencesException
- if errors occur during the population.- Since:
- MicroStrategy Web 9.0.1
- See Also:
PreferenceDefinitionBase.setAttributes(Attributes, PreferenceLevels)
-
buildXmlAttributes
protected void buildXmlAttributes(XMLBuilder builder)
Constructs an XML representation of the preference definition. Persists the following attributes: name, value, description, type, scope, and the implementation class of PreferenceDefinition (omitted if PreferenceDefinitionImpl).- Specified by:
buildXmlAttributes
in classPreferenceDefinitionBase
- Parameters:
builder
-- See Also:
PreferenceDefinitionBase.buildXmlAttributes(XMLBuilder)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPreferenceDefinitionBase
-
-