FileDocCategorySizeDatePackage
SecurityRoleMapping.javaAPI DocGlassfish v2 API16755Fri May 04 22:34:40 BST 2007com.sun.enterprise.tools.common.dd

SecurityRoleMapping

public class SecurityRoleMapping extends com.sun.enterprise.tools.common.dd.SunBaseBean
This generated bean class SecurityRoleMapping matches the schema element security-role-mapping Generated on Wed Aug 13 12:10:41 PDT 2003

Fields Summary
static Vector
comparators
public static final String
ROLE_NAME
public static final String
PRINCIPAL_NAME
public static final String
GROUP_NAME
Constructors Summary
public SecurityRoleMapping()

	// NOI18N

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

		super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
		// Properties (see root bean comments for the bean graph)
		this.createProperty("role-name", 	// NOI18N
			ROLE_NAME, 
			Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("principal-name", 	// NOI18N
			PRINCIPAL_NAME, Common.SEQUENCE_OR | 
			Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("group-name", 	// NOI18N
			GROUP_NAME, Common.SEQUENCE_OR | 
			Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.initialize(options);
	
Methods Summary
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddGroupName(java.lang.String value)

		return this.addValue(GROUP_NAME, value);
	
public intaddPrincipalName(java.lang.String value)

		return this.addValue(PRINCIPAL_NAME, value);
	
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("RoleName");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getRoleName();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(ROLE_NAME, 0, str, indent);

		str.append(indent);
		str.append("PrincipalName["+this.sizePrincipalName()+"]");	// NOI18N
		for(int i=0; i<this.sizePrincipalName(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			str.append(indent+"\t");	// NOI18N
			str.append("<");	// NOI18N
			s = this.getPrincipalName(i);
			str.append((s==null?"null":s.trim()));	// NOI18N
			str.append(">\n");	// NOI18N
			this.dumpAttributes(PRINCIPAL_NAME, i, str, indent);
		}

		str.append(indent);
		str.append("GroupName["+this.sizeGroupName()+"]");	// NOI18N
		for(int i=0; i<this.sizeGroupName(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			str.append(indent+"\t");	// NOI18N
			str.append("<");	// NOI18N
			s = this.getGroupName(i);
			str.append((s==null?"null":s.trim()));	// NOI18N
			str.append(">\n");	// NOI18N
			this.dumpAttributes(GROUP_NAME, i, str, indent);
		}

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("SecurityRoleMapping\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public java.lang.StringgetGroupName(int index)

		return (String)this.getValue(GROUP_NAME, index);
	
public java.lang.String[]getGroupName()

		return (String[])this.getValues(GROUP_NAME);
	
public java.lang.StringgetPrincipalName(int index)

		return (String)this.getValue(PRINCIPAL_NAME, index);
	
public java.lang.String[]getPrincipalName()

		return (String[])this.getValues(PRINCIPAL_NAME);
	
public java.lang.StringgetRoleName()

		return (String)this.getValue(ROLE_NAME);
	
voidinitialize(int options)

			
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremoveGroupName(java.lang.String value)

		return this.removeValue(GROUP_NAME, value);
	
public intremovePrincipalName(java.lang.String value)

		return this.removeValue(PRINCIPAL_NAME, value);
	
public voidsetGroupName(int index, java.lang.String value)

		this.setValue(GROUP_NAME, index, value);
	
public voidsetGroupName(java.lang.String[] value)

		this.setValue(GROUP_NAME, value);
	
public voidsetPrincipalName(int index, java.lang.String value)

		this.setValue(PRINCIPAL_NAME, index, value);
	
public voidsetPrincipalName(java.lang.String[] value)

		this.setValue(PRINCIPAL_NAME, value);
	
public voidsetRoleName(java.lang.String value)

		this.setValue(ROLE_NAME, value);
	
public intsizeGroupName()

		return this.size(GROUP_NAME);
	
public intsizePrincipalName()

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

		boolean restrictionFailure = false;
		// Validating property roleName
		if (getRoleName() == null) {
			throw new org.netbeans.modules.schema2beans.ValidateException("getRoleName() == null", "roleName", this);	// NOI18N
		}
		// Validating property principalName
		for (int _index = 0; _index < sizePrincipalName(); ++_index) {
			String element = getPrincipalName(_index);
			if (element != null) {
			}
		}
		int orCount = 0;
		if (sizePrincipalName() > 0) {
			++orCount;
		}
		// Validating property groupName
		for (int _index = 0; _index < sizeGroupName(); ++_index) {
			String element = getGroupName(_index);
			if (element != null) {
			}
		}
		if (sizeGroupName() > 0) {
			++orCount;
		}
		if (orCount != 1) {
			throw new org.netbeans.modules.schema2beans.ValidateException("orCount ("+orCount+") != 1", "mutually exclusive properties", this);	// NOI18N
		}