|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.grouping.critters.BaseCritterType
public abstract class BaseCritterType
BaseCritterType provides common routines for setting up type descriptions, getting localized strings, and validating creation parameters. Subclasses should call initialize() in the constructor.
Constructor Summary | |
---|---|
BaseCritterType()
|
Method Summary | |
---|---|
protected void |
addEnumPropDescription(java.lang.String propId,
java.lang.Class enumClass,
boolean required)
|
protected void |
addPropDescription(java.lang.String propId,
CritterPropType type)
|
protected void |
addPropDescription(java.lang.String propId,
CritterPropType type,
boolean required)
Adds a prop description which will get returned via getPropDescriptions(). |
java.util.ResourceBundle |
getBundle()
|
java.lang.String |
getDescription()
Returns a localized description 'Matches resource names against a regular expression' 'Matches resources modified before or after a date' |
java.text.MessageFormat |
getInstanceConfig()
Returns a localized MessageFormat, useful for returning the critter config. |
java.lang.String |
getName()
Returns a localized name of this critter 'Resource Name' 'Modified Time' |
java.util.List |
getPropDescriptions()
Returns a list of CritterPropDescription s, describing the order
and constitution of the props
"What arguments do I need to configure this critter?" |
protected java.lang.String |
getResourceProperty(java.lang.String propSuffix)
|
protected void |
initialize(java.lang.String bundleName,
java.lang.String propPrefix)
Initialize the name and description of the critter as well as internal storage for prop descriptions. |
protected void |
validate(java.util.Map props)
Validate a list of CritterPropDescription s against the
previously defined descriptions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.hyperic.hq.grouping.CritterType |
---|
compose, decompose, isSystem, isUserVisible, newInstance |
Constructor Detail |
---|
public BaseCritterType()
Method Detail |
---|
protected java.lang.String getResourceProperty(java.lang.String propSuffix)
protected void initialize(java.lang.String bundleName, java.lang.String propPrefix)
bundleName
- Name of the resource bundle (org.hyperc.hq...Resources)propPrefix
- Prefix to use before all properties.
The BaseCritterType will load properties for in the following form:
propPrefix.critter.name=
propPrefix.critter.desc=
propPrefix.critterProp.propId.name=
propPrefix.critterProp.propId.purpose=
Where propId can be specified for all the different properties a
resource supports. propId must match the value returned from
CritterProp.getId()protected void addPropDescription(java.lang.String propId, CritterPropType type, boolean required)
propName
- The property name to use when looking up the localized
value.type
- The critter prop typerequired
- If true, the property is required to create the critter
propName is used in conjunction with the propPrefix (from initialize())
The properties loaded from the resource bundle will be of the following
form:
propPrefix.critterProp.propName.name
propPrefix.critterProp.propName.purpose
Each call to addPropDescription adds a new property, and thus will
require 2 more localized properties.protected void addEnumPropDescription(java.lang.String propId, java.lang.Class enumClass, boolean required)
protected void addPropDescription(java.lang.String propId, CritterPropType type)
public java.util.List getPropDescriptions()
CritterType
CritterPropDescription
s, describing the order
and constitution of the props
"What arguments do I need to configure this critter?"
getPropDescriptions
in interface CritterType
public java.lang.String getDescription()
CritterType
getDescription
in interface CritterType
public java.lang.String getName()
CritterType
getName
in interface CritterType
public java.util.ResourceBundle getBundle()
protected void validate(java.util.Map props) throws GroupException
CritterPropDescription
s against the
previously defined descriptions.
Calls to addPropDescription() pre-populate the critter type with the
props that are valid. This method ensures that a list of
CritterPropDescription
s match the valid types.
props
- a map of propIds onto CritterProps
GroupException
public java.text.MessageFormat getInstanceConfig()
Critter.getConfig()
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |