站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

AbstractBuilder (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.metadata
Class AbstractBuilder

java.lang.Object
  extended byorg.jboss.mx.metadata.AbstractBuilder
All Implemented Interfaces:
MetaDataBuilder
Direct Known Subclasses:
JBossXMBean10, StandardMetaData, XMLMetaData

public abstract class AbstractBuilder
extends Object
implements MetaDataBuilder

Abstract helper class for builder implementations. Includes accessors for property values that can deal with either string values or equivalent object types (such as string "true" or Boolean(true)).

Version:
$Revision: 1.4 $
Author:
Juha Lindfors.
See Also:
MetaDataBuilder

Field Summary
protected  Map properties
          Configuration properties.
 
Constructor Summary
AbstractBuilder()
          Default constructor.
AbstractBuilder(Map properties)
           
 
Method Summary
abstract  MBeanInfo build()
          Constructs the Model MBean metadata.
 boolean getBooleanProperty(String key)
          Returns true for Boolean(true) and strings "true" and "T" (case insensitive).
protected  Map getProperties()
          Returns the property map of this builder instance.
 Object getProperty(String key)
          Returns the value of a given configuration property.
 String getStringProperty(String key)
          Returns a string property or null if key does not exist.
protected  void setProperties(Map properties)
          Sets a copy of a properties map to this builder instance.
 void setProperty(String key, Object value)
          Sets a builder configuration property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected Map properties
Configuration properties.

Constructor Detail

AbstractBuilder

public AbstractBuilder()
Default constructor.


AbstractBuilder

public AbstractBuilder(Map properties)
Method Detail

getBooleanProperty

public boolean getBooleanProperty(String key)
                           throws IllegalPropertyException
Returns true for Boolean(true) and strings "true" and "T" (case insensitive). Returns false for Boolean(false) and strings "false" and "F".

Parameters:
key - to lookup
Returns:
true or false
Throws:
IllegalPropertyException - if property value is not either Boolean or String type or they key value is null or a string contained an unknown value

getStringProperty

public String getStringProperty(String key)
Returns a string property or null if key does not exist.


setProperty

public void setProperty(String key,
                        Object value)
Sets a builder configuration property.

Specified by:
setProperty in interface MetaDataBuilder
Parameters:
key - unique string key for a property
value - property value

getProperty

public Object getProperty(String key)
Returns the value of a given configuration property.

Specified by:
getProperty in interface MetaDataBuilder
Parameters:
key - property key string
Returns:
property value

build

public abstract MBeanInfo build()
                         throws NotCompliantMBeanException
Description copied from interface: MetaDataBuilder
Constructs the Model MBean metadata.

Specified by:
build in interface MetaDataBuilder
Returns:
initialized MBean info
Throws:
NotCompliantMBeanException - if there were errors building the MBean info from the given data source

setProperties

protected void setProperties(Map properties)
Sets a copy of a properties map to this builder instance.

Parameters:
properties - configuration properties

getProperties

protected Map getProperties()
Returns the property map of this builder instance.



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.