FileDocCategorySizeDatePackage
SunApplication.javaAPI DocGlassfish v2 API15477Fri May 04 22:34:40 BST 2007com.sun.enterprise.tools.common.dd.application

SunApplication

public class SunApplication extends com.sun.enterprise.tools.common.dd.SunBaseBean
This generated bean class SunApplication matches the schema element sun-application Generated on Thu Jul 31 15:31:46 PDT 2003 This class matches the root element of the DTD, and is the root of the following bean graph: sun-application : SunApplication web : Web[0,n] web-uri : String context-root : String pass-by-reference : String? unique-id : String? security-role-mapping : SecurityRoleMapping[0,n] role-name : String ( | principal-name : String | group-name : String )[1,n] realm : String?

Fields Summary
static Vector
comparators
public static final String
WEB
public static final String
PASS_BY_REFERENCE
public static final String
UNIQUE_ID
public static final String
SECURITY_ROLE_MAPPING
public static final String
REALM
Constructors Summary
public SunApplication()

	// NOI18N

	    
		this(null, Common.USE_DEFAULT_VALUES);
	
public SunApplication(Node doc, int options)

		this(Common.NO_DEFAULT_VALUES);
		initFromNode(doc, options);
	
public SunApplication(int options)

		super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
		initOptions(options);
	
Methods Summary
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)

		return this.addValue(SECURITY_ROLE_MAPPING, value);
	
public intaddWeb(com.sun.enterprise.tools.common.dd.application.Web value)

		return this.addValue(WEB, value);
	
public static com.sun.enterprise.tools.common.dd.application.SunApplicationcreateGraph(org.w3c.dom.Node doc)

		return new SunApplication(doc, Common.NO_DEFAULT_VALUES);
	
public static com.sun.enterprise.tools.common.dd.application.SunApplicationcreateGraph(java.io.InputStream in)

		return createGraph(in, false);
	
public static com.sun.enterprise.tools.common.dd.application.SunApplicationcreateGraph(java.io.InputStream in, boolean validate)

		Document doc = GraphManager.createXmlDocument(in, validate);
		return createGraph(doc);
	
public static com.sun.enterprise.tools.common.dd.application.SunApplicationcreateGraph()

		try {
			return new SunApplication();
		}
		catch (Schema2BeansException e) {
			throw new RuntimeException(e.getMessage());
		}
	
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("Web["+this.sizeWeb()+"]");	// NOI18N
		for(int i=0; i<this.sizeWeb(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getWeb(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(WEB, i, str, indent);
		}

		str.append(indent);
		str.append("PassByReference");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getPassByReference();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(PASS_BY_REFERENCE, 0, str, indent);

		str.append(indent);
		str.append("UniqueId");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getUniqueId();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(UNIQUE_ID, 0, str, indent);

		str.append(indent);
		str.append("SecurityRoleMapping["+this.sizeSecurityRoleMapping()+"]");	// NOI18N
		for(int i=0; i<this.sizeSecurityRoleMapping(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getSecurityRoleMapping(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(SECURITY_ROLE_MAPPING, i, str, indent);
		}

		str.append(indent);
		str.append("Realm");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getRealm();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(REALM, 0, str, indent);

	
public java.lang.StringdumpBeanNode()

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

		return (String)this.getValue(PASS_BY_REFERENCE);
	
public java.lang.StringgetRealm()

		return (String)this.getValue(REALM);
	
public com.sun.enterprise.tools.common.dd.SecurityRoleMappinggetSecurityRoleMapping(int index)

		return (SecurityRoleMapping)this.getValue(SECURITY_ROLE_MAPPING, index);
	
public com.sun.enterprise.tools.common.dd.SecurityRoleMapping[]getSecurityRoleMapping()

		return (SecurityRoleMapping[])this.getValues(SECURITY_ROLE_MAPPING);
	
public java.lang.StringgetUniqueId()

		return (String)this.getValue(UNIQUE_ID);
	
public com.sun.enterprise.tools.common.dd.application.Web[]getWeb()

		return (Web[])this.getValues(WEB);
	
public com.sun.enterprise.tools.common.dd.application.WebgetWeb(int index)

		return (Web)this.getValue(WEB, index);
	
protected voidinitFromNode(org.w3c.dom.Node doc, int options)

		if (doc == null)
		{
			doc = GraphManager.createRootElementNode("sun-application");	// NOI18N
			if (doc == null)
				throw new Schema2BeansException(Common.getMessage(
					"CantCreateDOMRoot_msg", "sun-application"));
		}
		Node n = GraphManager.getElementNode("sun-application", doc);	// NOI18N
		if (n == null)
			throw new Schema2BeansException(Common.getMessage(
				"DocRootNotInDOMGraph_msg", "sun-application", doc.getFirstChild().getNodeName()));

		this.graphManager.setXmlDocument(doc);

		// Entry point of the createBeans() recursive calls
		this.createBean(n, this.graphManager());
		this.initialize(options);
	
protected voidinitOptions(int options)

		// The graph manager is allocated in the bean root
		this.graphManager = new GraphManager(this);
		this.createRoot("sun-application", "SunApplication",	// NOI18N
			Common.TYPE_1 | Common.TYPE_BEAN, SunApplication.class);

		// Properties (see root bean comments for the bean graph)
		this.createProperty("web", 	// NOI18N
			WEB, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			Web.class);
		this.createProperty("pass-by-reference", 	// NOI18N
			PASS_BY_REFERENCE, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("unique-id", 	// NOI18N
			UNIQUE_ID, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("security-role-mapping", 	// NOI18N
			SECURITY_ROLE_MAPPING, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			SecurityRoleMapping.class);
		this.createProperty("realm", 	// NOI18N
			REALM, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.initialize(options);
	
voidinitialize(int options)

			
	
private voidreadObject(java.io.ObjectInputStream in)

		try{
			init(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
			String strDocument = in.readUTF();
			// System.out.println("strDocument='"+strDocument+"'");
			ByteArrayInputStream bais = new ByteArrayInputStream(strDocument.getBytes());
			Document doc = GraphManager.createXmlDocument(bais, false);
			initOptions(Common.NO_DEFAULT_VALUES);
			initFromNode(doc, Common.NO_DEFAULT_VALUES);
		}
		catch (Schema2BeansException e) {
			e.printStackTrace();
			throw new RuntimeException(e.getMessage());
		}
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremoveSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)

		return this.removeValue(SECURITY_ROLE_MAPPING, value);
	
public intremoveWeb(com.sun.enterprise.tools.common.dd.application.Web value)

		return this.removeValue(WEB, value);
	
public voidsetPassByReference(java.lang.String value)

		this.setValue(PASS_BY_REFERENCE, value);
	
public voidsetRealm(java.lang.String value)

		this.setValue(REALM, value);
	
public voidsetSecurityRoleMapping(int index, com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)

		this.setValue(SECURITY_ROLE_MAPPING, index, value);
	
public voidsetSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping[] value)

		this.setValue(SECURITY_ROLE_MAPPING, value);
	
public voidsetUniqueId(java.lang.String value)

		this.setValue(UNIQUE_ID, value);
	
public voidsetWeb(int index, com.sun.enterprise.tools.common.dd.application.Web value)

		this.setValue(WEB, index, value);
	
public voidsetWeb(com.sun.enterprise.tools.common.dd.application.Web[] value)

		this.setValue(WEB, value);
	
public intsizeSecurityRoleMapping()

		return this.size(SECURITY_ROLE_MAPPING);
	
public intsizeWeb()

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

		boolean restrictionFailure = false;
		// Validating property web
		for (int _index = 0; _index < sizeWeb(); ++_index) {
			com.sun.enterprise.tools.common.dd.application.Web element = getWeb(_index);
			if (element != null) {
				element.validate();
			}
		}
		// Validating property passByReference
		if (getPassByReference() != null) {
		}
		// Validating property uniqueId
		if (getUniqueId() != null) {
		}
		// Validating property securityRoleMapping
		for (int _index = 0; _index < sizeSecurityRoleMapping(); ++_index) {
			SecurityRoleMapping element = getSecurityRoleMapping(_index);
			if (element != null) {
				element.validate();
			}
		}
		// Validating property realm
		if (getRealm() != null) {
		}
	
private voidwriteObject(java.io.ObjectOutputStream out)

		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		write(baos);
		String str = baos.toString();;
		// System.out.println("str='"+str+"'");
		out.writeUTF(str);