FileDocCategorySizeDatePackage
Constraints.javaAPI DocGlassfish v2 API11043Fri May 04 22:35:00 BST 2007com.sun.enterprise.tools.common.validation.constraints.data

Constraints

public class Constraints extends org.netbeans.modules.schema2beans.BaseBean
This generated bean class Constraints matches the schema element constraints Generated on Wed Aug 20 17:20:08 PDT 2003 This class matches the root element of the DTD, and is the root of the following bean graph: constraints : Constraints check-info : CheckInfo[0,n] name : String classname : String arguments : Arguments? argument : Argument[1,n] name : String type : String?

Fields Summary
static Vector
comparators
public static final String
CHECK_INFO
Constructors Summary
public Constraints()

	// NOI18N

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

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

		super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
		initOptions(options);
	
Methods Summary
public intaddCheckInfo(com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo value)

		return this.addValue(CHECK_INFO, value);
	
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public static com.sun.enterprise.tools.common.validation.constraints.data.ConstraintscreateGraph(org.w3c.dom.Node doc)

		return new Constraints(doc, Common.NO_DEFAULT_VALUES);
	
public static com.sun.enterprise.tools.common.validation.constraints.data.ConstraintscreateGraph(java.io.InputStream in)

		return createGraph(in, false);
	
public static com.sun.enterprise.tools.common.validation.constraints.data.ConstraintscreateGraph(java.io.InputStream in, boolean validate)

		Document doc = GraphManager.createXmlDocument(in, validate);
		return createGraph(doc);
	
public static com.sun.enterprise.tools.common.validation.constraints.data.ConstraintscreateGraph()

		try {
			return new Constraints();
		}
		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("CheckInfo["+this.sizeCheckInfo()+"]");	// NOI18N
		for(int i=0; i<this.sizeCheckInfo(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getCheckInfo(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(CHECK_INFO, i, str, indent);
		}

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("Constraints\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo[]getCheckInfo()

		return (CheckInfo[])this.getValues(CHECK_INFO);
	
public com.sun.enterprise.tools.common.validation.constraints.data.CheckInfogetCheckInfo(int index)

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

		if (doc == null)
		{
			doc = GraphManager.createRootElementNode("constraints");	// NOI18N
			if (doc == null)
				throw new Schema2BeansException(Common.getMessage(
					"CantCreateDOMRoot_msg", "constraints"));
		}
		Node n = GraphManager.getElementNode("constraints", doc);	// NOI18N
		if (n == null)
			throw new Schema2BeansException(Common.getMessage(
				"DocRootNotInDOMGraph_msg", "constraints", 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("constraints", "Constraints",	// NOI18N
			Common.TYPE_1 | Common.TYPE_BEAN, Constraints.class);

		// Properties (see root bean comments for the bean graph)
		this.createProperty("check-info", 	// NOI18N
			CHECK_INFO, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			CheckInfo.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 intremoveCheckInfo(com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo value)

		return this.removeValue(CHECK_INFO, value);
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public voidsetCheckInfo(int index, com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo value)

		this.setValue(CHECK_INFO, index, value);
	
public voidsetCheckInfo(com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo[] value)

		this.setValue(CHECK_INFO, value);
	
public intsizeCheckInfo()

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

		boolean restrictionFailure = false;
		// Validating property checkInfo
		for (int _index = 0; _index < sizeCheckInfo(); ++_index) {
			com.sun.enterprise.tools.common.validation.constraints.data.CheckInfo element = getCheckInfo(_index);
			if (element != null) {
				element.validate();
			}
		}
	
private voidwriteObject(java.io.ObjectOutputStream out)

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