Methods Summary |
---|
public int | addBooleanProperty(java.lang.String value)
return this.addValue(BOOLEAN_PROPERTY, value);
|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addNumberProperty(java.lang.String value)
return this.addValue(NUMBER_PROPERTY, value);
|
public int | addObjectEight(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight value)
return this.addValue(OBJECT_EIGHT, value);
|
public int | addObjectFive(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive value)
return this.addValue(OBJECT_FIVE, value);
|
public int | addObjectSeven(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven value)
return this.addValue(OBJECT_SEVEN, value);
|
public int | addObjectSix(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix value)
return this.addValue(OBJECT_SIX, value);
|
public static com.sun.enterprise.tools.common.validation.samples.simple.beans.RootElement | createGraph(org.w3c.dom.Node doc)
return new RootElement(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.tools.common.validation.samples.simple.beans.RootElement | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.tools.common.validation.samples.simple.beans.RootElement | createGraph(java.io.InputStream in, boolean validate)
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
|
public static com.sun.enterprise.tools.common.validation.samples.simple.beans.RootElement | createGraph()
try {
return new RootElement();
}
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("NonZeroLengthProperty"); // NOI18N
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getNonZeroLengthProperty();
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(NON_ZERO_LENGTH_PROPERTY, 0, str, indent);
str.append(indent);
str.append("NumberProperty["+this.sizeNumberProperty()+"]"); // NOI18N
for(int i=0; i<this.sizeNumberProperty(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getNumberProperty(i);
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(NUMBER_PROPERTY, i, str, indent);
}
str.append(indent);
str.append("BooleanProperty["+this.sizeBooleanProperty()+"]"); // NOI18N
for(int i=0; i<this.sizeBooleanProperty(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getBooleanProperty(i);
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(BOOLEAN_PROPERTY, i, str, indent);
}
str.append(indent);
str.append("RangeProperty"); // NOI18N
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getRangeProperty();
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(RANGE_PROPERTY, 0, str, indent);
str.append(indent);
str.append("EnumerationProperty"); // NOI18N
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getEnumerationProperty();
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(ENUMERATION_PROPERTY, 0, str, indent);
str.append(indent);
str.append("ObjectOne"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectOne();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_ONE, 0, str, indent);
str.append(indent);
str.append("ObjectTwo"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectTwo();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_TWO, 0, str, indent);
str.append(indent);
str.append("ObjectThree"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectThree();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_THREE, 0, str, indent);
str.append(indent);
str.append("ObjectFour"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectFour();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_FOUR, 0, str, indent);
str.append(indent);
str.append("ObjectFive["+this.sizeObjectFive()+"]"); // NOI18N
for(int i=0; i<this.sizeObjectFive(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectFive(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_FIVE, i, str, indent);
}
str.append(indent);
str.append("ObjectSix["+this.sizeObjectSix()+"]"); // NOI18N
for(int i=0; i<this.sizeObjectSix(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectSix(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_SIX, i, str, indent);
}
str.append(indent);
str.append("ObjectSeven["+this.sizeObjectSeven()+"]"); // NOI18N
for(int i=0; i<this.sizeObjectSeven(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectSeven(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_SEVEN, i, str, indent);
}
str.append(indent);
str.append("ObjectEight["+this.sizeObjectEight()+"]"); // NOI18N
for(int i=0; i<this.sizeObjectEight(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getObjectEight(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(OBJECT_EIGHT, i, str, indent);
}
|
public java.lang.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("RootElement\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public java.lang.String | getBooleanProperty(int index)
return (String)this.getValue(BOOLEAN_PROPERTY, index);
|
public java.lang.String[] | getBooleanProperty()
return (String[])this.getValues(BOOLEAN_PROPERTY);
|
public java.lang.String | getEnumerationProperty()
return (String)this.getValue(ENUMERATION_PROPERTY);
|
public java.lang.String | getNonZeroLengthProperty()
return (String)this.getValue(NON_ZERO_LENGTH_PROPERTY);
|
public java.lang.String | getNumberProperty(int index)
return (String)this.getValue(NUMBER_PROPERTY, index);
|
public java.lang.String[] | getNumberProperty()
return (String[])this.getValues(NUMBER_PROPERTY);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight | getObjectEight(int index)
return (ObjectEight)this.getValue(OBJECT_EIGHT, index);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight[] | getObjectEight()
return (ObjectEight[])this.getValues(OBJECT_EIGHT);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive | getObjectFive(int index)
return (ObjectFive)this.getValue(OBJECT_FIVE, index);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive[] | getObjectFive()
return (ObjectFive[])this.getValues(OBJECT_FIVE);
|
public ObjectFour | getObjectFour()
return (ObjectFour)this.getValue(OBJECT_FOUR);
|
public ObjectOne | getObjectOne()
return (ObjectOne)this.getValue(OBJECT_ONE);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven | getObjectSeven(int index)
return (ObjectSeven)this.getValue(OBJECT_SEVEN, index);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven[] | getObjectSeven()
return (ObjectSeven[])this.getValues(OBJECT_SEVEN);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix | getObjectSix(int index)
return (ObjectSix)this.getValue(OBJECT_SIX, index);
|
public com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix[] | getObjectSix()
return (ObjectSix[])this.getValues(OBJECT_SIX);
|
public ObjectThree | getObjectThree()
return (ObjectThree)this.getValue(OBJECT_THREE);
|
public ObjectTwo | getObjectTwo()
return (ObjectTwo)this.getValue(OBJECT_TWO);
|
public java.lang.String | getRangeProperty()
return (String)this.getValue(RANGE_PROPERTY);
|
protected void | initFromNode(org.w3c.dom.Node doc, int options)
if (doc == null)
{
doc = GraphManager.createRootElementNode("root-element"); // NOI18N
if (doc == null)
throw new Schema2BeansException(Common.getMessage(
"CantCreateDOMRoot_msg", "root-element"));
}
Node n = GraphManager.getElementNode("root-element", doc); // NOI18N
if (n == null)
throw new Schema2BeansException(Common.getMessage(
"DocRootNotInDOMGraph_msg", "root-element", 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("root-element", "RootElement", // NOI18N
Common.TYPE_1 | Common.TYPE_BEAN, RootElement.class);
// Properties (see root bean comments for the bean graph)
this.createProperty("non-zero-length-property", // NOI18N
NON_ZERO_LENGTH_PROPERTY,
Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("number-property", // NOI18N
NUMBER_PROPERTY,
Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("boolean-property", // NOI18N
BOOLEAN_PROPERTY,
Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("range-property", // NOI18N
RANGE_PROPERTY,
Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("enumeration-property", // NOI18N
ENUMERATION_PROPERTY,
Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("object-one", // NOI18N
OBJECT_ONE,
Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectOne.class);
this.createProperty("object-two", // NOI18N
OBJECT_TWO,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectTwo.class);
this.createProperty("object-three", // NOI18N
OBJECT_THREE,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectThree.class);
this.createProperty("object-four", // NOI18N
OBJECT_FOUR,
Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectFour.class);
this.createProperty("object-five", // NOI18N
OBJECT_FIVE,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectFive.class);
this.createProperty("object-six", // NOI18N
OBJECT_SIX,
Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectSix.class);
this.createProperty("object-seven", // NOI18N
OBJECT_SEVEN,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectSeven.class);
this.createProperty("object-eight", // NOI18N
OBJECT_EIGHT,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ObjectEight.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 int | removeBooleanProperty(java.lang.String value)
return this.removeValue(BOOLEAN_PROPERTY, value);
|
public static void | removeComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.remove(c);
|
public int | removeNumberProperty(java.lang.String value)
return this.removeValue(NUMBER_PROPERTY, value);
|
public int | removeObjectEight(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight value)
return this.removeValue(OBJECT_EIGHT, value);
|
public int | removeObjectFive(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive value)
return this.removeValue(OBJECT_FIVE, value);
|
public int | removeObjectSeven(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven value)
return this.removeValue(OBJECT_SEVEN, value);
|
public int | removeObjectSix(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix value)
return this.removeValue(OBJECT_SIX, value);
|
public void | setBooleanProperty(int index, java.lang.String value)
this.setValue(BOOLEAN_PROPERTY, index, value);
|
public void | setBooleanProperty(java.lang.String[] value)
this.setValue(BOOLEAN_PROPERTY, value);
|
public void | setEnumerationProperty(java.lang.String value)
this.setValue(ENUMERATION_PROPERTY, value);
|
public void | setNonZeroLengthProperty(java.lang.String value)
this.setValue(NON_ZERO_LENGTH_PROPERTY, value);
|
public void | setNumberProperty(java.lang.String[] value)
this.setValue(NUMBER_PROPERTY, value);
|
public void | setNumberProperty(int index, java.lang.String value)
this.setValue(NUMBER_PROPERTY, index, value);
|
public void | setObjectEight(int index, com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight value)
this.setValue(OBJECT_EIGHT, index, value);
|
public void | setObjectEight(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight[] value)
this.setValue(OBJECT_EIGHT, value);
|
public void | setObjectFive(int index, com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive value)
this.setValue(OBJECT_FIVE, index, value);
|
public void | setObjectFive(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive[] value)
this.setValue(OBJECT_FIVE, value);
|
public void | setObjectFour(ObjectFour value)
this.setValue(OBJECT_FOUR, value);
|
public void | setObjectOne(ObjectOne value)
this.setValue(OBJECT_ONE, value);
|
public void | setObjectSeven(int index, com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven value)
this.setValue(OBJECT_SEVEN, index, value);
|
public void | setObjectSeven(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven[] value)
this.setValue(OBJECT_SEVEN, value);
|
public void | setObjectSix(int index, com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix value)
this.setValue(OBJECT_SIX, index, value);
|
public void | setObjectSix(com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix[] value)
this.setValue(OBJECT_SIX, value);
|
public void | setObjectThree(ObjectThree value)
this.setValue(OBJECT_THREE, value);
|
public void | setObjectTwo(ObjectTwo value)
this.setValue(OBJECT_TWO, value);
|
public void | setRangeProperty(java.lang.String value)
this.setValue(RANGE_PROPERTY, value);
|
public int | sizeBooleanProperty()
return this.size(BOOLEAN_PROPERTY);
|
public int | sizeNumberProperty()
return this.size(NUMBER_PROPERTY);
|
public int | sizeObjectEight()
return this.size(OBJECT_EIGHT);
|
public int | sizeObjectFive()
return this.size(OBJECT_FIVE);
|
public int | sizeObjectSeven()
return this.size(OBJECT_SEVEN);
|
public int | sizeObjectSix()
return this.size(OBJECT_SIX);
|
public void | validate()
boolean restrictionFailure = false;
// Validating property nonZeroLengthProperty
if (getNonZeroLengthProperty() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getNonZeroLengthProperty() == null", "nonZeroLengthProperty", this); // NOI18N
}
// Validating property numberProperty
if (sizeNumberProperty() == 0) {
throw new org.netbeans.modules.schema2beans.ValidateException("sizeNumberProperty() == 0", "numberProperty", this); // NOI18N
}
for (int _index = 0; _index < sizeNumberProperty(); ++_index) {
String element = getNumberProperty(_index);
if (element != null) {
}
}
// Validating property booleanProperty
for (int _index = 0; _index < sizeBooleanProperty(); ++_index) {
String element = getBooleanProperty(_index);
if (element != null) {
}
}
// Validating property rangeProperty
if (getRangeProperty() != null) {
}
// Validating property enumerationProperty
if (getEnumerationProperty() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getEnumerationProperty() == null", "enumerationProperty", this); // NOI18N
}
// Validating property objectOne
if (getObjectOne() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getObjectOne() == null", "objectOne", this); // NOI18N
}
getObjectOne().validate();
// Validating property objectTwo
if (getObjectTwo() != null) {
getObjectTwo().validate();
}
// Validating property objectThree
if (getObjectThree() != null) {
getObjectThree().validate();
}
// Validating property objectFour
if (getObjectFour() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getObjectFour() == null", "objectFour", this); // NOI18N
}
getObjectFour().validate();
// Validating property objectFive
for (int _index = 0; _index < sizeObjectFive(); ++_index) {
com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectFive element = getObjectFive(_index);
if (element != null) {
element.validate();
}
}
// Validating property objectSix
if (sizeObjectSix() == 0) {
throw new org.netbeans.modules.schema2beans.ValidateException("sizeObjectSix() == 0", "objectSix", this); // NOI18N
}
for (int _index = 0; _index < sizeObjectSix(); ++_index) {
com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSix element = getObjectSix(_index);
if (element != null) {
element.validate();
}
}
// Validating property objectSeven
for (int _index = 0; _index < sizeObjectSeven(); ++_index) {
com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectSeven element = getObjectSeven(_index);
if (element != null) {
element.validate();
}
}
// Validating property objectEight
for (int _index = 0; _index < sizeObjectEight(); ++_index) {
com.sun.enterprise.tools.common.validation.samples.simple.beans.ObjectEight element = getObjectEight(_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);
|