FileDocCategorySizeDatePackage
ManagementRules.javaAPI DocGlassfish v2 API7219Fri May 26 10:47:08 BST 2006com.sun.enterprise.config.serverbeans

ManagementRules

public class ManagementRules extends com.sun.enterprise.config.ConfigBean implements Serializable
This generated bean class ManagementRules matches the DTD element management-rules

Fields Summary
static Vector
comparators
private static final org.netbeans.modules.schema2beans.Version
runtimeVersion
public static final String
MANAGEMENT_RULE
Constructors Summary
public ManagementRules()


	  
		this(Common.USE_DEFAULT_VALUES);
	
public ManagementRules(int options)

		super(comparators, runtimeVersion);
		// Properties (see root bean comments for the bean graph)
		initPropertyTables(1);
		this.createProperty("management-rule", MANAGEMENT_RULE, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			ManagementRule.class);
		this.createAttribute(MANAGEMENT_RULE, "name", "Name", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(MANAGEMENT_RULE, "enabled", "Enabled", 
						AttrProp.CDATA,
						null, "true");
		this.initialize(options);
	
Methods Summary
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddManagementRule(ManagementRule value)

		return addManagementRule(value, true);
	
public intaddManagementRule(ManagementRule value, boolean overwrite)

		ManagementRule old = getManagementRuleByName(value.getName());
		if(old != null) {
			throw new ConfigException(StringManager.getManager(ManagementRules.class).getString("cannotAddDuplicate",  "ManagementRule"));
		}
		return this.addValue(MANAGEMENT_RULE, value, overwrite);
	
public voiddump(java.lang.StringBuffer str, java.lang.String indent)

		String s;
		Object o;
		org.netbeans.modules.schema2beans.BaseBean n;
		str.append(indent);
		str.append("ManagementRule["+this.sizeManagementRule()+"]");	// NOI18N
		for(int i=0; i<this.sizeManagementRule(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getManagementRule(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(MANAGEMENT_RULE, i, str, indent);
		}

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("ManagementRules\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public static java.lang.StringgetDefaultAttributeValue(java.lang.String attr)

		if(attr == null) return null;
		attr = attr.trim();
		if(attr.equals(ServerTags.ENABLED)) return "true".trim();
	return null;
	
public static java.lang.StringgetDefaultEnabled()
Get the default value of Enabled from dtd

		return "true".trim();
	
public ManagementRulegetManagementRule(int index)

		return (ManagementRule)this.getValue(MANAGEMENT_RULE, index);
	
public ManagementRule[]getManagementRule()

		return (ManagementRule[])this.getValues(MANAGEMENT_RULE);
	
public ManagementRulegetManagementRuleByName(java.lang.String id)

	 if (null != id) { id = id.trim(); }
	ManagementRule[] o = getManagementRule();
	 if (o == null) return null;

	 for (int i=0; i < o.length; i++) {
	     if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
	         return o[i];
	     }
	 }

		return null;
		
	
protected java.lang.StringgetRelativeXPath()
get the xpath representation for this element returns something like abc[@name='value'] or abc depending on the type of the bean

	    String ret = null;
	    ret = "management-rules";
	    return (null != ret ? ret.trim() : null);
	
voidinitialize(int options)


	
public booleanisEnabled()
Getter for Enabled of the Element management-rules

return
the Enabled of the Element management-rules

		return toBoolean(getAttributeValue(ServerTags.ENABLED));
	
public ManagementRulenewManagementRule()
Create a new bean using it's default constructor. This does not add it to any bean graph.

		return new ManagementRule();
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremoveManagementRule(ManagementRule value)

		return this.removeValue(MANAGEMENT_RULE, value);
	
public intremoveManagementRule(ManagementRule value, boolean overwrite)

		return this.removeValue(MANAGEMENT_RULE, value, overwrite);
	
public voidsetEnabled(boolean v, boolean overwrite)
Modify the Enabled of the Element management-rules

param
v the new value
throws
StaleWriteConfigException if overwrite is false and file changed on disk

		setAttributeValue(ServerTags.ENABLED, ""+(v==true), overwrite);
	
public voidsetEnabled(boolean v)
Modify the Enabled of the Element management-rules

param
v the new value

		setAttributeValue(ServerTags.ENABLED, ""+(v==true));
	
public voidsetManagementRule(ManagementRule[] value)

		this.setValue(MANAGEMENT_RULE, value);
	
public intsizeManagementRule()

		return this.size(MANAGEMENT_RULE);
	
public voidvalidate()