FileDocCategorySizeDatePackage
MapElement.javaAPI DocGlassfish v2 API12724Fri May 04 22:34:40 BST 2007com.sun.enterprise.tools.common.dd.connector

MapElement

public class MapElement extends com.sun.enterprise.tools.common.dd.SunBaseBean
This generated bean class MapElement matches the schema element map-element Generated on Thu Jul 31 18:16:39 PDT 2003

Fields Summary
static Vector
comparators
public static final String
PRINCIPAL
public static final String
BACKEND_PRINCIPAL
public static final String
BACKENDPRINCIPALUSERNAME
public static final String
BACKENDPRINCIPALPASSWORD
public static final String
BACKENDPRINCIPALCREDENTIAL
Constructors Summary
public MapElement()

	// NOI18N

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

		super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
		// Properties (see root bean comments for the bean graph)
		this.createProperty("principal", 	// NOI18N
			PRINCIPAL, 
			Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			Principal.class);
		this.createAttribute(PRINCIPAL, "user-name", "UserName", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createProperty("backend-principal", 	// NOI18N
			BACKEND_PRINCIPAL, 
			Common.TYPE_0_1 | Common.TYPE_BOOLEAN | Common.TYPE_KEY, 
			Boolean.class);
		this.createAttribute(BACKEND_PRINCIPAL, "user-name", "UserName", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(BACKEND_PRINCIPAL, "password", "Password", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.createAttribute(BACKEND_PRINCIPAL, "credential", "Credential", 
						AttrProp.CDATA | AttrProp.REQUIRED,
						null, null);
		this.initialize(options);
	
Methods Summary
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddPrincipal(com.sun.enterprise.tools.common.dd.connector.Principal value)

		return this.addValue(PRINCIPAL, 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("Principal["+this.sizePrincipal()+"]");	// NOI18N
		for(int i=0; i<this.sizePrincipal(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getPrincipal(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(PRINCIPAL, i, str, indent);
		}

		str.append(indent);
		str.append("BackendPrincipal");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append((this.isBackendPrincipal()?"true":"false"));
		this.dumpAttributes(BACKEND_PRINCIPAL, 0, str, indent);

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("MapElement\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public java.lang.StringgetBackendPrincipalCredential()

		// If our element does not exist, then the attribute does not exist.
		if (size(BACKEND_PRINCIPAL) == 0) {
			return null;
		} else {
			return getAttributeValue(BACKEND_PRINCIPAL, "Credential");
		}
	
public java.lang.StringgetBackendPrincipalPassword()

		// If our element does not exist, then the attribute does not exist.
		if (size(BACKEND_PRINCIPAL) == 0) {
			return null;
		} else {
			return getAttributeValue(BACKEND_PRINCIPAL, "Password");
		}
	
public java.lang.StringgetBackendPrincipalUserName()

		// If our element does not exist, then the attribute does not exist.
		if (size(BACKEND_PRINCIPAL) == 0) {
			return null;
		} else {
			return getAttributeValue(BACKEND_PRINCIPAL, "UserName");
		}
	
public com.sun.enterprise.tools.common.dd.connector.PrincipalgetPrincipal(int index)

		return (Principal)this.getValue(PRINCIPAL, index);
	
public com.sun.enterprise.tools.common.dd.connector.Principal[]getPrincipal()

		return (Principal[])this.getValues(PRINCIPAL);
	
voidinitialize(int options)

	
	
public booleanisBackendPrincipal()

		Boolean ret = (Boolean)this.getValue(BACKEND_PRINCIPAL);
		if (ret == null)
			ret = (Boolean)Common.defaultScalarValue(Common.TYPE_BOOLEAN);
		return ((java.lang.Boolean)ret).booleanValue();
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremovePrincipal(com.sun.enterprise.tools.common.dd.connector.Principal value)

		return this.removeValue(PRINCIPAL, value);
	
public voidsetBackendPrincipal(boolean value)

		this.setValue(BACKEND_PRINCIPAL, (value ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE));
	
public voidsetBackendPrincipalCredential(java.lang.String value)

		// Make sure we've got a place to put this attribute.
		if (size(BACKEND_PRINCIPAL) == 0) {
			setValue(BACKEND_PRINCIPAL, "");
		}
		setAttributeValue(BACKEND_PRINCIPAL, "Credential", value);
	
public voidsetBackendPrincipalPassword(java.lang.String value)

		// Make sure we've got a place to put this attribute.
		if (size(BACKEND_PRINCIPAL) == 0) {
			setValue(BACKEND_PRINCIPAL, "");
		}
		setAttributeValue(BACKEND_PRINCIPAL, "Password", value);
	
public voidsetBackendPrincipalUserName(java.lang.String value)

		// Make sure we've got a place to put this attribute.
		if (size(BACKEND_PRINCIPAL) == 0) {
			setValue(BACKEND_PRINCIPAL, "");
		}
		setAttributeValue(BACKEND_PRINCIPAL, "UserName", value);
	
public voidsetPrincipal(int index, com.sun.enterprise.tools.common.dd.connector.Principal value)

		this.setValue(PRINCIPAL, index, value);
	
public voidsetPrincipal(com.sun.enterprise.tools.common.dd.connector.Principal[] value)

		this.setValue(PRINCIPAL, value);
	
public intsizePrincipal()

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

		boolean restrictionFailure = false;
		// Validating property principal
		if (sizePrincipal() == 0) {
			throw new org.netbeans.modules.schema2beans.ValidateException("sizePrincipal() == 0", "principal", this);	// NOI18N
		}
		for (int _index = 0; _index < sizePrincipal(); ++_index) {
			com.sun.enterprise.tools.common.dd.connector.Principal element = getPrincipal(_index);
			if (element != null) {
				element.validate();
			}
		}
		// Validating property backendPrincipal
		// Validating property backendPrincipalUserName
		if (getBackendPrincipalUserName() == null) {
			throw new org.netbeans.modules.schema2beans.ValidateException("getBackendPrincipalUserName() == null", "backendPrincipalUserName", this);	// NOI18N
		}
		// Validating property backendPrincipalPassword
		if (getBackendPrincipalPassword() == null) {
			throw new org.netbeans.modules.schema2beans.ValidateException("getBackendPrincipalPassword() == null", "backendPrincipalPassword", this);	// NOI18N
		}
		// Validating property backendPrincipalCredential
		if (getBackendPrincipalCredential() == null) {
			throw new org.netbeans.modules.schema2beans.ValidateException("getBackendPrincipalCredential() == null", "backendPrincipalCredential", this);	// NOI18N
		}