Methods Summary |
---|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addElement(com.sun.enterprise.tools.common.validation.data.Element value)
return this.addValue(ELEMENT, value);
|
public static com.sun.enterprise.tools.common.validation.data.Validation | createGraph(org.w3c.dom.Node doc)
return new Validation(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.tools.common.validation.data.Validation | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.tools.common.validation.data.Validation | createGraph(java.io.InputStream in, boolean validate)
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
|
public static com.sun.enterprise.tools.common.validation.data.Validation | createGraph()
try {
return new Validation();
}
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("Element["+this.sizeElement()+"]"); // NOI18N
for(int i=0; i<this.sizeElement(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getElement(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(ELEMENT, i, str, indent);
}
|
public java.lang.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("Validation\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public com.sun.enterprise.tools.common.validation.data.Element | getElement(int index)
return (Element)this.getValue(ELEMENT, index);
|
public com.sun.enterprise.tools.common.validation.data.Element[] | getElement()
return (Element[])this.getValues(ELEMENT);
|
public java.lang.String | getValidate()
return getAttributeValue(VALIDATE);
|
protected void | initFromNode(org.w3c.dom.Node doc, int options)
if (doc == null)
{
doc = GraphManager.createRootElementNode("validation"); // NOI18N
if (doc == null)
throw new Schema2BeansException(Common.getMessage(
"CantCreateDOMRoot_msg", "validation"));
}
Node n = GraphManager.getElementNode("validation", doc); // NOI18N
if (n == null)
throw new Schema2BeansException(Common.getMessage(
"DocRootNotInDOMGraph_msg", "validation", 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("validation", "Validation", // NOI18N
Common.TYPE_1 | Common.TYPE_BEAN, Validation.class);
// Properties (see root bean comments for the bean graph)
this.createProperty("element", // NOI18N
ELEMENT,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
Element.class);
this.createAttribute("validate", "Validate",
AttrProp.ENUM,
new String[] {
"true",
"false"
}, "true");
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 | removeElement(com.sun.enterprise.tools.common.validation.data.Element value)
return this.removeValue(ELEMENT, value);
|
public void | setElement(com.sun.enterprise.tools.common.validation.data.Element[] value)
this.setValue(ELEMENT, value);
|
public void | setElement(int index, com.sun.enterprise.tools.common.validation.data.Element value)
this.setValue(ELEMENT, index, value);
|
public void | setValidate(java.lang.String value)
setAttributeValue(VALIDATE, value);
|
public int | sizeElement()
return this.size(ELEMENT);
|
public void | validate()
boolean restrictionFailure = false;
// Validating property validate
if (getValidate() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getValidate() == null", "validate", this); // NOI18N
}
// Validating property element
for (int _index = 0; _index < sizeElement(); ++_index) {
com.sun.enterprise.tools.common.validation.data.Element element = getElement(_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);
|