Methods Summary |
---|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)
return this.addValue(SECURITY_ROLE_MAPPING, value);
|
public int | addWeb(com.sun.enterprise.tools.common.dd.application.Web value)
return this.addValue(WEB, value);
|
public static com.sun.enterprise.tools.common.dd.application.SunApplication | createGraph(org.w3c.dom.Node doc)
return new SunApplication(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.tools.common.dd.application.SunApplication | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.tools.common.dd.application.SunApplication | createGraph(java.io.InputStream in, boolean validate)
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
|
public static com.sun.enterprise.tools.common.dd.application.SunApplication | createGraph()
try {
return new SunApplication();
}
catch (Schema2BeansException e) {
throw new RuntimeException(e.getMessage());
}
|
public void | dump(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.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("SunApplication\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public java.lang.String | getPassByReference()
return (String)this.getValue(PASS_BY_REFERENCE);
|
public java.lang.String | getRealm()
return (String)this.getValue(REALM);
|
public com.sun.enterprise.tools.common.dd.SecurityRoleMapping | getSecurityRoleMapping(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.String | getUniqueId()
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.Web | getWeb(int index)
return (Web)this.getValue(WEB, index);
|
protected void | initFromNode(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 void | initOptions(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);
|
void | initialize(int options)
|
private void | readObject(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 void | removeComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.remove(c);
|
public int | removeSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)
return this.removeValue(SECURITY_ROLE_MAPPING, value);
|
public int | removeWeb(com.sun.enterprise.tools.common.dd.application.Web value)
return this.removeValue(WEB, value);
|
public void | setPassByReference(java.lang.String value)
this.setValue(PASS_BY_REFERENCE, value);
|
public void | setRealm(java.lang.String value)
this.setValue(REALM, value);
|
public void | setSecurityRoleMapping(int index, com.sun.enterprise.tools.common.dd.SecurityRoleMapping value)
this.setValue(SECURITY_ROLE_MAPPING, index, value);
|
public void | setSecurityRoleMapping(com.sun.enterprise.tools.common.dd.SecurityRoleMapping[] value)
this.setValue(SECURITY_ROLE_MAPPING, value);
|
public void | setUniqueId(java.lang.String value)
this.setValue(UNIQUE_ID, value);
|
public void | setWeb(int index, com.sun.enterprise.tools.common.dd.application.Web value)
this.setValue(WEB, index, value);
|
public void | setWeb(com.sun.enterprise.tools.common.dd.application.Web[] value)
this.setValue(WEB, value);
|
public int | sizeSecurityRoleMapping()
return this.size(SECURITY_ROLE_MAPPING);
|
public int | sizeWeb()
return this.size(WEB);
|
public void | validate()
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 void | writeObject(java.io.ObjectOutputStream out)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
write(baos);
String str = baos.toString();;
// System.out.println("str='"+str+"'");
out.writeUTF(str);
|