blob: 1a29b435625be0786e20bd76839e19def269c517 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* This generated bean class ChildObjectOne matches the schema element child-object-one
*
*/
package org.netbeans.modules.j2ee.sun.validation.samples.simple.beans;
import org.w3c.dom.*;
import org.netbeans.modules.schema2beans.*;
import java.beans.*;
import java.util.*;
// BEGIN_NOI18N
public class ChildObjectOne extends org.netbeans.modules.schema2beans.BaseBean
{
static Vector comparators = new Vector();
static public final String PROPERTY_ONE = "PropertyOne"; // NOI18N
static public final String PROPERTY_TWO = "PropertyTwo"; // NOI18N
public ChildObjectOne() {
this(Common.USE_DEFAULT_VALUES);
}
public ChildObjectOne(int options)
{
super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
// Properties (see root bean comments for the bean graph)
this.createProperty("property-one", // NOI18N
PROPERTY_ONE,
Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.createProperty("property-two", // NOI18N
PROPERTY_TWO,
Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
String.class);
this.initialize(options);
}
// Setting the default values of the properties
void initialize(int options)
{
}
// This attribute is mandatory
public void setPropertyOne(String value) {
this.setValue(PROPERTY_ONE, value);
}
//
public String getPropertyOne() {
return (String)this.getValue(PROPERTY_ONE);
}
// This attribute is optional
public void setPropertyTwo(String value) {
this.setValue(PROPERTY_TWO, value);
}
//
public String getPropertyTwo() {
return (String)this.getValue(PROPERTY_TWO);
}
//
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
comparators.add(c);
}
//
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
comparators.remove(c);
}
public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
boolean restrictionFailure = false;
// Validating property propertyOne
if (getPropertyOne() == null) {
throw new org.netbeans.modules.schema2beans.ValidateException("getPropertyOne() == null", "propertyOne", this); // NOI18N
}
// Validating property propertyTwo
if (getPropertyTwo() != null) {
}
}
// Dump the content of this bean returning it as a String
public void dump(StringBuffer str, String indent){
String s;
Object o;
org.netbeans.modules.schema2beans.BaseBean n;
str.append(indent);
str.append("PropertyOne"); // NOI18N
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getPropertyOne();
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(PROPERTY_ONE, 0, str, indent);
str.append(indent);
str.append("PropertyTwo"); // NOI18N
str.append(indent+"\t"); // NOI18N
str.append("<"); // NOI18N
s = this.getPropertyTwo();
str.append((s==null?"null":s.trim())); // NOI18N
str.append(">\n"); // NOI18N
this.dumpAttributes(PROPERTY_TWO, 0, str, indent);
}
public String dumpBeanNode(){
StringBuffer str = new StringBuffer();
str.append("ChildObjectOne\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
}}
// END_NOI18N
/*
The following schema file has been used for generation:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : sample.dtd
Created on : May 8, 2003, 11:18 AM
Author : Rajeshwar Patil
Description:
Purpose of the document follows.
-->
<!--
-->
<!ELEMENT root-element (non-zero-length-property, number-property+,
boolean-property*, range-property?, enumeration-property,
object-one, object-two?, object-three?, object-four,
object-five*, object-six+, object-seven*,object-eight*)>
<!--
-->
<!ELEMENT object-one (property-one, property-two?)>
<!--
-->
<!ELEMENT object-two (property-one, property-two)>
<!--
-->
<!ELEMENT object-three (property-one, property-two?,
property-three+, property-four*)>
<!--
-->
<!ELEMENT object-four (property-one?, property-two?)>
<!--
-->
<!ELEMENT object-five (property-one, property-two?)>
<!--
-->
<!ELEMENT object-six (property-one?, property-two?)>
<!--
-->
<!ELEMENT object-seven (property-one, property-two)>
<!--
-->
<!ELEMENT object-eight (property-one, property-two?, child-object-one,
child-object-two?, child-object-three*, child-object-four+)>
<!--
-->
<!ELEMENT child-object-one (property-one, property-two?)>
<!--
-->
<!ELEMENT child-object-two (property-one, property-two)>
<!--
-->
<!ELEMENT child-object-three (property-one?, property-two?)>
<!--
-->
<!ELEMENT child-object-four (property-one, property-two?,
property-three+, property-four*)>
<!ELEMENT boolean-property (#PCDATA)>
<!ELEMENT number-property (#PCDATA)>
<!ELEMENT non-zero-length-property (#PCDATA)>
<!ELEMENT range-property (#PCDATA)>
<!ELEMENT enumeration-property (#PCDATA)>
<!ELEMENT property-one (#PCDATA)>
<!ELEMENT property-two (#PCDATA)>
<!ELEMENT property-three (#PCDATA)>
<!ELEMENT property-four (#PCDATA)>
*/