Methods Summary |
---|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addEjbRef(com.sun.enterprise.tools.common.dd.EjbRef value)
return this.addValue(EJB_REF, value);
|
public int | addMessageDestination(com.sun.enterprise.tools.common.dd.MessageDestination value)
return this.addValue(MESSAGE_DESTINATION, value);
|
public int | addResourceEnvRef(com.sun.enterprise.tools.common.dd.ResourceEnvRef value)
return this.addValue(RESOURCE_ENV_REF, value);
|
public int | addResourceRef(com.sun.enterprise.tools.common.dd.ResourceRef value)
return this.addValue(RESOURCE_REF, value);
|
public int | addServiceRef(com.sun.enterprise.tools.common.dd.ServiceRef value)
return this.addValue(SERVICE_REF, value);
|
public static com.sun.enterprise.tools.common.dd.appclient.SunApplicationClient | createGraph(org.w3c.dom.Node doc)
return new SunApplicationClient(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.tools.common.dd.appclient.SunApplicationClient | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.tools.common.dd.appclient.SunApplicationClient | createGraph(java.io.InputStream in, boolean validate)
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
|
public static com.sun.enterprise.tools.common.dd.appclient.SunApplicationClient | createGraph()
try {
return new SunApplicationClient();
}
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("EjbRef["+this.sizeEjbRef()+"]"); // NOI18N
for(int i=0; i<this.sizeEjbRef(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getEjbRef(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(EJB_REF, i, str, indent);
}
str.append(indent);
str.append("ResourceRef["+this.sizeResourceRef()+"]"); // NOI18N
for(int i=0; i<this.sizeResourceRef(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getResourceRef(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(RESOURCE_REF, i, str, indent);
}
str.append(indent);
str.append("ResourceEnvRef["+this.sizeResourceEnvRef()+"]"); // NOI18N
for(int i=0; i<this.sizeResourceEnvRef(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getResourceEnvRef(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(RESOURCE_ENV_REF, i, str, indent);
}
str.append(indent);
str.append("ServiceRef["+this.sizeServiceRef()+"]"); // NOI18N
for(int i=0; i<this.sizeServiceRef(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getServiceRef(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(SERVICE_REF, i, str, indent);
}
str.append(indent);
str.append("MessageDestination["+this.sizeMessageDestination()+"]"); // NOI18N
for(int i=0; i<this.sizeMessageDestination(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMessageDestination(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(MESSAGE_DESTINATION, i, str, indent);
}
|
public java.lang.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("SunApplicationClient\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public com.sun.enterprise.tools.common.dd.EjbRef[] | getEjbRef()
return (EjbRef[])this.getValues(EJB_REF);
|
public com.sun.enterprise.tools.common.dd.EjbRef | getEjbRef(int index)
return (EjbRef)this.getValue(EJB_REF, index);
|
public com.sun.enterprise.tools.common.dd.MessageDestination | getMessageDestination(int index)
return (MessageDestination)this.getValue(MESSAGE_DESTINATION, index);
|
public com.sun.enterprise.tools.common.dd.MessageDestination[] | getMessageDestination()
return (MessageDestination[])this.getValues(MESSAGE_DESTINATION);
|
public com.sun.enterprise.tools.common.dd.ResourceEnvRef | getResourceEnvRef(int index)
return (ResourceEnvRef)this.getValue(RESOURCE_ENV_REF, index);
|
public com.sun.enterprise.tools.common.dd.ResourceEnvRef[] | getResourceEnvRef()
return (ResourceEnvRef[])this.getValues(RESOURCE_ENV_REF);
|
public com.sun.enterprise.tools.common.dd.ResourceRef | getResourceRef(int index)
return (ResourceRef)this.getValue(RESOURCE_REF, index);
|
public com.sun.enterprise.tools.common.dd.ResourceRef[] | getResourceRef()
return (ResourceRef[])this.getValues(RESOURCE_REF);
|
public com.sun.enterprise.tools.common.dd.ServiceRef | getServiceRef(int index)
return (ServiceRef)this.getValue(SERVICE_REF, index);
|
public com.sun.enterprise.tools.common.dd.ServiceRef[] | getServiceRef()
return (ServiceRef[])this.getValues(SERVICE_REF);
|
protected void | initFromNode(org.w3c.dom.Node doc, int options)
if (doc == null)
{
doc = GraphManager.createRootElementNode("sun-application-client"); // NOI18N
if (doc == null)
throw new Schema2BeansException(Common.getMessage(
"CantCreateDOMRoot_msg", "sun-application-client"));
}
Node n = GraphManager.getElementNode("sun-application-client", doc); // NOI18N
if (n == null)
throw new Schema2BeansException(Common.getMessage(
"DocRootNotInDOMGraph_msg", "sun-application-client", 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-client", "SunApplicationClient", // NOI18N
Common.TYPE_1 | Common.TYPE_BEAN, SunApplicationClient.class);
// Properties (see root bean comments for the bean graph)
this.createProperty("ejb-ref", // NOI18N
EJB_REF,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
EjbRef.class);
this.createProperty("resource-ref", // NOI18N
RESOURCE_REF,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ResourceRef.class);
this.createProperty("resource-env-ref", // NOI18N
RESOURCE_ENV_REF,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ResourceEnvRef.class);
this.createProperty("service-ref", // NOI18N
SERVICE_REF,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ServiceRef.class);
this.createProperty("message-destination", // NOI18N
MESSAGE_DESTINATION,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
MessageDestination.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 | removeEjbRef(com.sun.enterprise.tools.common.dd.EjbRef value)
return this.removeValue(EJB_REF, value);
|
public int | removeMessageDestination(com.sun.enterprise.tools.common.dd.MessageDestination value)
return this.removeValue(MESSAGE_DESTINATION, value);
|
public int | removeResourceEnvRef(com.sun.enterprise.tools.common.dd.ResourceEnvRef value)
return this.removeValue(RESOURCE_ENV_REF, value);
|
public int | removeResourceRef(com.sun.enterprise.tools.common.dd.ResourceRef value)
return this.removeValue(RESOURCE_REF, value);
|
public int | removeServiceRef(com.sun.enterprise.tools.common.dd.ServiceRef value)
return this.removeValue(SERVICE_REF, value);
|
public void | setEjbRef(int index, com.sun.enterprise.tools.common.dd.EjbRef value)
this.setValue(EJB_REF, index, value);
|
public void | setEjbRef(com.sun.enterprise.tools.common.dd.EjbRef[] value)
this.setValue(EJB_REF, value);
|
public void | setMessageDestination(int index, com.sun.enterprise.tools.common.dd.MessageDestination value)
this.setValue(MESSAGE_DESTINATION, index, value);
|
public void | setMessageDestination(com.sun.enterprise.tools.common.dd.MessageDestination[] value)
this.setValue(MESSAGE_DESTINATION, value);
|
public void | setResourceEnvRef(int index, com.sun.enterprise.tools.common.dd.ResourceEnvRef value)
this.setValue(RESOURCE_ENV_REF, index, value);
|
public void | setResourceEnvRef(com.sun.enterprise.tools.common.dd.ResourceEnvRef[] value)
this.setValue(RESOURCE_ENV_REF, value);
|
public void | setResourceRef(int index, com.sun.enterprise.tools.common.dd.ResourceRef value)
this.setValue(RESOURCE_REF, index, value);
|
public void | setResourceRef(com.sun.enterprise.tools.common.dd.ResourceRef[] value)
this.setValue(RESOURCE_REF, value);
|
public void | setServiceRef(int index, com.sun.enterprise.tools.common.dd.ServiceRef value)
this.setValue(SERVICE_REF, index, value);
|
public void | setServiceRef(com.sun.enterprise.tools.common.dd.ServiceRef[] value)
this.setValue(SERVICE_REF, value);
|
public int | sizeEjbRef()
return this.size(EJB_REF);
|
public int | sizeMessageDestination()
return this.size(MESSAGE_DESTINATION);
|
public int | sizeResourceEnvRef()
return this.size(RESOURCE_ENV_REF);
|
public int | sizeResourceRef()
return this.size(RESOURCE_REF);
|
public int | sizeServiceRef()
return this.size(SERVICE_REF);
|
public void | validate()
boolean restrictionFailure = false;
// Validating property ejbRef
for (int _index = 0; _index < sizeEjbRef(); ++_index) {
EjbRef element = getEjbRef(_index);
if (element != null) {
element.validate();
}
}
// Validating property resourceRef
for (int _index = 0; _index < sizeResourceRef(); ++_index) {
ResourceRef element = getResourceRef(_index);
if (element != null) {
element.validate();
}
}
// Validating property resourceEnvRef
for (int _index = 0; _index < sizeResourceEnvRef(); ++_index) {
ResourceEnvRef element = getResourceEnvRef(_index);
if (element != null) {
element.validate();
}
}
// Validating property serviceRef
for (int _index = 0; _index < sizeServiceRef(); ++_index) {
ServiceRef element = getServiceRef(_index);
if (element != null) {
element.validate();
}
}
// Validating property messageDestination
for (int _index = 0; _index < sizeMessageDestination(); ++_index) {
MessageDestination element = getMessageDestination(_index);
if (element != null) {
element.validate();
}
}
|
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);
|