First Commit from Source Code Reply

This commit is contained in:
vincenzofariello
2024-05-09 17:40:24 +02:00
parent 11e3b57c5b
commit 107a016cb9
35225 changed files with 1111346 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
Sample: Validation
Author: Steven Traut (straut@bea.com)
Last Updated: May 25, 2005
Versions:
xmlbeans-v1 1.0.3
xmlbeans-v2
-----------------------------------------------------------------------------
This sample illustrates how you can use the XMLBeans API to validate
XML instances against schema. The API provides two validation features:
- A validate method (available from XmlOjbect and types generated from schema)
with which you can validate the bound instance and collect error messages that
result.
- An option through which you can specify that simple schema types should
be validated by XMLBeans when your code sets their value. This feature
will simply throw an exception if setting the value renders the instance
invalid.
Because it uses invalid XML for illustration, this sample is designed to "fail"
when it runs. When you run this sample, you'll see it print two blocks of information
in the console:
- A message containing errors resulting from calling the validate method
on invalid XML.
- The stack trace of an exception resulting from setting an invalid value
when the XmlOptions.VALIDATE_ON_SET option has been specified.
Note that you can also validate at the command line using tools provided
in the bin directory of the XMLBeans distribution.
To try out this sample:
1. Set XMLBEANS_HOME in your environment
2. Ant must be on your PATH
3. To compile the schemas and sample source, run "ant build"
4. To execute the sample, run "ant run"

View File

@@ -0,0 +1,120 @@
<!--
Copyright 2004 The Apache Software Foundation
Licensed 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.
-->
<project name="Validation" default="build">
<property environment="env"/>
<path id="Validation.path">
<path refid="xmlbeans.path"/>
<fileset dir="build/lib" includes="*.jar"/>
<pathelement path="build/classes"/>
</path>
<target name="init">
<property name="xmlbeans.home" value="${env.XMLBEANS_HOME}"/>
<echo message="xmlbeans.home: ${xmlbeans.home}"/>
<!-- check for xbean.jar from binary distribution -->
<available
property="xmlbeans.lib"
value="${xmlbeans.home}/lib"
file="${xmlbeans.home}/lib/xbean.jar" />
<!-- check for xbean.jar compiled from source -->
<available
property="xmlbeans.lib"
value="${xmlbeans.home}/build/lib"
file="${xmlbeans.home}/build/lib/xbean.jar" />
<fail message="Set XMLBEANS_HOME in your environment."
unless="xmlbeans.lib"/>
<echo message="xmlbeans.lib: ${xmlbeans.lib}"/>
<path id="xmlbeans.path">
<fileset dir="${xmlbeans.lib}" includes="*.jar"/>
</path>
<taskdef name="xmlbean"
classname="org.apache.xmlbeans.impl.tool.XMLBean"
classpathref="xmlbeans.path"/>
</target>
<!-- ========================== clean ==== -->
<target name="clean">
<delete dir="build"/>
</target>
<!-- ========================== build ==== -->
<target name="build" depends="init,schemas.jar,Validation.classes">
</target>
<target name="schemas.check">
<uptodate property="schemas.notRequired"
targetfile="build/lib/schemas.jar">
<srcfiles dir="schemas" includes="**/*.xsd"/>
</uptodate>
</target>
<target name="schemas.jar" depends="init,schemas.check"
unless="schemas.notRequired">
<mkdir dir="build/lib"/>
<xmlbean schema="schemas"
destfile="build/lib/schemas.jar"
srcgendir="src"
classpathref="xmlbeans.path"
debug="on"
/>
</target>
<target name="Validation.classes" depends="init">
<mkdir dir="build/classes"/>
<javac srcdir="src"
destdir="build/classes"
classpathref="Validation.path"
debug="on"
source="1.4"
/>
</target>
<!-- ========================== run ==== -->
<target name="run" depends="init,build">
<echo message="============================== running Validation"/>
<java
classname="org.apache.xmlbeans.samples.validation.Validation"
classpathref="Validation.path"
fork="true">
<arg line="xml/todolist.xml"/>
</java>
</target>
<!-- ========================== test ==== -->
<target name="test" depends="init,build">
<echo message="============================== testing Validation"/>
<java
classname="org.apache.xmlbeans.samples.validation.ValidationTest"
classpathref="Validation.path"
fork="true">
<arg line="xml/todolist.xml"/>
</java>
</target>
</project>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed 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.
-->
<xs:schema targetNamespace="http://xmlbeans.apache.org/samples/validation/todolist" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xmlbeans.apache.org/samples/validation/todolist" elementFormDefault="qualified">
<xs:element name="todolist">
<xs:complexType>
<xs:sequence>
<xs:element name="item" type="itemType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="itemType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="description" type="xs:string" minOccurs="0"/>
<xs:element name="due_by" type="xs:dateTime" minOccurs="0"/>
<xs:element name="action" type="actionType"/>
</xs:sequence>
<xs:attribute name="id" type="idType"/>
</xs:complexType>
<xs:simpleType name="nameType">
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="idType">
<xs:restriction base="xs:int">
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="actionType">
<xs:restriction base="xs:string">
<xs:enumeration value="do"/>
<xs:enumeration value="delegate"/>
<xs:enumeration value="someday_maybe_defer"/>
<xs:enumeration value="toss"/>
<xs:enumeration value="incubate"/>
<xs:enumeration value="file"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@@ -0,0 +1,188 @@
/* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.
*/
package org.apache.xmlbeans.samples.validation;
import org.apache.xmlbeans.*;
import org.apache.xmlbeans.samples.validation.todolist.*;
import org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
/**
* A sample to illustrate two means for validating XML against schema
* using features of the XMLBeans API. The features illustrated are:
*
* - Validating after changes by using the XmlObject.validate method.
* This method is exposed by types generated by compiling schema. The
* validate method validates instances against all aspects of schema.
* Also, with this method you can specify a Collection instance to
* capture errors that occur during validation.
*
* - Validating "on the fly" using the XmlOptions.VALIDATE_ON_SET constant.
* This option prompts XMLBeans to validate XML against simple schema types
* <em>as you set them</em>, rather than by expressly calling for validation.
* You can set this option by calling XmlOptions.setValidateOnSet, then
* specifying the XmlOptions instance as a parameter when creating
* a new instance from schema or parsing an existing one.
*
* Note that it is also possible to validate instances from the
* command line by using tools you'll find in the bin directory of the
* XMLBeans distribution.
*/
public class Validation
{
private static XmlOptions m_validationOptions;
/**
* Receives a todo list XML instance, twice rendering it invalid
* and validating it using the XMLBeans API.
*
* @param args An array in which the first item is a
* path to the XML instance file.
*/
public static void main(String[] args)
{
Validation thisSample = new Validation();
// Use the validate method to validate an instance after
// updates.
boolean isValidAfterChanges = thisSample.isValidAfterChanges(args[0]);
// Use the VALIDATE_ON_SET option to validate an instance
// as updates are made.
boolean isValidOnTheFly = thisSample.isValidOnTheFly(args[0]);
}
/**
* Illustrates use of the validate method by making changes to incoming
* XML that invalidate the XML, then validating the instance and
* printing resulting error messages.
*
* Because this code is designed to generate invalid XML, it
* returns false when successful.
*
* @param xmlPath A path to the XML instance file.
* @return <code>true if the XML is valid after changes;
* otherwise, <code>false</code>.
*/
public boolean isValidAfterChanges(String xmlPath)
{
System.out.println("Validating after changes: \n");
// Set up the validation error listener.
ArrayList validationErrors = new ArrayList();
m_validationOptions = new XmlOptions();
m_validationOptions.setErrorListener(validationErrors);
TodolistDocument todoList = (TodolistDocument)parseXml(xmlPath, null);
// Schema defines the <name> element as required (minOccurs = '1').
// So this statement renders the XML invalid because it sets the
// <name> element to nil.
todoList.getTodolist().getItemArray(0).setName(null);
// During validation, errors are added to the ArrayList for
// retrieval and printing by the printErrors method.
boolean isValid = todoList.validate(m_validationOptions);
if (!isValid)
{
printErrors(validationErrors);
}
return isValid;
}
/**
* Illustrates the "validate on set" feature, which validates XML
* for simple types on the fly. As XML for those types is "set" through
* accessors generated by compiling schema, XMLBeans checks the XML's
* validity. The code here uses generated types to retrieve the first
* <item> in a <todolist>, then update the <item>'s id attribute. The code
* throws an exception when it tries to set an id attribute value that
* is too high.
*
* Because this code is designed to generate invalid XML, it
* returns false when successful.
*
* @param xmlPath A path to the XML instance file.
* @return <code>true</code> if valid XML is successfully created;
* otherwise, <code>false</code>.
*/
public boolean isValidOnTheFly(String xmlPath)
{
System.out.println("Validating on-the-fly: \n");
m_validationOptions = new XmlOptions();
m_validationOptions.setValidateOnSet();
TodolistDocument todoList = (TodolistDocument)parseXml(xmlPath, m_validationOptions);
Todolist list = todoList.getTodolist();
ItemType firstItem = list.getItemArray(0);
// Schema defines the <id> element as allowing values up to 100. So
// this line throws an exception because it invalidates the XML the
// code is updating.
firstItem.setId(8587);
// This line will not be reached.
return todoList.validate();
}
/**
* Receives the collection containing errors found during
* validation and print the errors to the console.
*
* @param validationErrors The validation errors.
*/
public void printErrors(ArrayList validationErrors)
{
System.out.println("Errors discovered during validation: \n");
Iterator iter = validationErrors.iterator();
while (iter.hasNext())
{
System.out.println(">> " + iter.next() + "\n");
}
}
/**
* <p>Creates a File from the XML path provided in main arguments, then
* parses the file's contents into a type generated from schema.</p>
* <p/>
* <p>Note that this work might have been done in main. Isolating it here
* makes the code separately available from outside this class.</p>
*
* @param xmlFilePath A path to XML based on the schema in inventory.xsd.
* @return An instance of a generated schema type that contains the parsed
* XML.
*/
public XmlObject parseXml(String xmlFilePath, XmlOptions validationOptions)
{
File xmlFile = new File(xmlFilePath);
XmlObject xml = null;
try
{
xml = XmlObject.Factory.parse(xmlFile, validationOptions);
} catch (XmlException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
return xml;
}
}

View File

@@ -0,0 +1,43 @@
/* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.
*/
package org.apache.xmlbeans.samples.validation;
import org.apache.xmlbeans.samples.validation.Validation;
/**
* A class with which to test the Validation sample.
*/
public class ValidationTest
{
/**
* Tests the Validation sample.
*/
public static void main(String[] args)
{
// all we're checking for is that the sample doesn't throw anything.
// a real sample test might assert something more interesting.
Validation sample = new Validation();
// Use the validate method to validate an instance after
// updates.
boolean isValidAfterChanges = sample.isValidAfterChanges(args[0]);
assert !isValidAfterChanges;
// Use the VALIDATE_ON_SET option to validate an instance
// as updates are made.
boolean isValidOnTheFly = sample.isValidOnTheFly(args[0]);
assert !isValidOnTheFly;
}
}

View File

@@ -0,0 +1,170 @@
/*
* XML Type: actionType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.ActionType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist;
/**
* An XML actionType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlString.
*/
public interface ActionType extends org.apache.xmlbeans.XmlString
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("actiontype5fa0type");
org.apache.xmlbeans.StringEnumAbstractBase enumValue();
void set(org.apache.xmlbeans.StringEnumAbstractBase e);
static final Enum DO = Enum.forString("do");
static final Enum DELEGATE = Enum.forString("delegate");
static final Enum SOMEDAY_MAYBE_DEFER = Enum.forString("someday_maybe_defer");
static final Enum TOSS = Enum.forString("toss");
static final Enum INCUBATE = Enum.forString("incubate");
static final Enum FILE = Enum.forString("file");
static final int INT_DO = Enum.INT_DO;
static final int INT_DELEGATE = Enum.INT_DELEGATE;
static final int INT_SOMEDAY_MAYBE_DEFER = Enum.INT_SOMEDAY_MAYBE_DEFER;
static final int INT_TOSS = Enum.INT_TOSS;
static final int INT_INCUBATE = Enum.INT_INCUBATE;
static final int INT_FILE = Enum.INT_FILE;
/**
* Enumeration value class for org.apache.xmlbeans.samples.validation.todolist.ActionType.
* These enum values can be used as follows:
* <pre>
* enum.toString(); // returns the string value of the enum
* enum.intValue(); // returns an int value, useful for switches
* // e.g., case Enum.INT_DO
* Enum.forString(s); // returns the enum value for a string
* Enum.forInt(i); // returns the enum value for an int
* </pre>
* Enumeration objects are immutable singleton objects that
* can be compared using == object equality. They have no
* public constructor. See the constants defined within this
* class for all the valid values.
*/
static final class Enum extends org.apache.xmlbeans.StringEnumAbstractBase
{
/**
* Returns the enum value for a string, or null if none.
*/
public static Enum forString(java.lang.String s)
{ return (Enum)table.forString(s); }
/**
* Returns the enum value corresponding to an int, or null if none.
*/
public static Enum forInt(int i)
{ return (Enum)table.forInt(i); }
private Enum(java.lang.String s, int i)
{ super(s, i); }
static final int INT_DO = 1;
static final int INT_DELEGATE = 2;
static final int INT_SOMEDAY_MAYBE_DEFER = 3;
static final int INT_TOSS = 4;
static final int INT_INCUBATE = 5;
static final int INT_FILE = 6;
public static final org.apache.xmlbeans.StringEnumAbstractBase.Table table =
new org.apache.xmlbeans.StringEnumAbstractBase.Table
(
new Enum[]
{
new Enum("do", INT_DO),
new Enum("delegate", INT_DELEGATE),
new Enum("someday_maybe_defer", INT_SOMEDAY_MAYBE_DEFER),
new Enum("toss", INT_TOSS),
new Enum("incubate", INT_INCUBATE),
new Enum("file", INT_FILE),
}
);
private static final long serialVersionUID = 1L;
private java.lang.Object readResolve() { return forInt(intValue()); }
}
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.ActionType newValue(java.lang.Object obj) {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) type.newValue( obj ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.ActionType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.ActionType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}

View File

@@ -0,0 +1,98 @@
/*
* XML Type: idType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.IdType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist;
/**
* An XML idType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlInt.
*/
public interface IdType extends org.apache.xmlbeans.XmlInt
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("idtypef11btype");
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.IdType newValue(java.lang.Object obj) {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) type.newValue( obj ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.IdType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.IdType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}

View File

@@ -0,0 +1,225 @@
/*
* XML Type: itemType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.ItemType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist;
/**
* An XML itemType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is a complex type.
*/
public interface ItemType extends org.apache.xmlbeans.XmlObject
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("itemtypeb663type");
/**
* Gets the "name" element
*/
java.lang.String getName();
/**
* Gets (as xml) the "name" element
*/
org.apache.xmlbeans.XmlString xgetName();
/**
* Sets the "name" element
*/
void setName(java.lang.String name);
/**
* Sets (as xml) the "name" element
*/
void xsetName(org.apache.xmlbeans.XmlString name);
/**
* Gets the "description" element
*/
java.lang.String getDescription();
/**
* Gets (as xml) the "description" element
*/
org.apache.xmlbeans.XmlString xgetDescription();
/**
* True if has "description" element
*/
boolean isSetDescription();
/**
* Sets the "description" element
*/
void setDescription(java.lang.String description);
/**
* Sets (as xml) the "description" element
*/
void xsetDescription(org.apache.xmlbeans.XmlString description);
/**
* Unsets the "description" element
*/
void unsetDescription();
/**
* Gets the "due_by" element
*/
java.util.Calendar getDueBy();
/**
* Gets (as xml) the "due_by" element
*/
org.apache.xmlbeans.XmlDateTime xgetDueBy();
/**
* True if has "due_by" element
*/
boolean isSetDueBy();
/**
* Sets the "due_by" element
*/
void setDueBy(java.util.Calendar dueBy);
/**
* Sets (as xml) the "due_by" element
*/
void xsetDueBy(org.apache.xmlbeans.XmlDateTime dueBy);
/**
* Unsets the "due_by" element
*/
void unsetDueBy();
/**
* Gets the "action" element
*/
org.apache.xmlbeans.samples.validation.todolist.ActionType.Enum getAction();
/**
* Gets (as xml) the "action" element
*/
org.apache.xmlbeans.samples.validation.todolist.ActionType xgetAction();
/**
* Sets the "action" element
*/
void setAction(org.apache.xmlbeans.samples.validation.todolist.ActionType.Enum action);
/**
* Sets (as xml) the "action" element
*/
void xsetAction(org.apache.xmlbeans.samples.validation.todolist.ActionType action);
/**
* Gets the "id" attribute
*/
int getId();
/**
* Gets (as xml) the "id" attribute
*/
org.apache.xmlbeans.samples.validation.todolist.IdType xgetId();
/**
* True if has "id" attribute
*/
boolean isSetId();
/**
* Sets the "id" attribute
*/
void setId(int id);
/**
* Sets (as xml) the "id" attribute
*/
void xsetId(org.apache.xmlbeans.samples.validation.todolist.IdType id);
/**
* Unsets the "id" attribute
*/
void unsetId();
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.ItemType newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.ItemType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.ItemType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}

View File

@@ -0,0 +1,98 @@
/*
* XML Type: nameType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.NameType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist;
/**
* An XML nameType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlString.
*/
public interface NameType extends org.apache.xmlbeans.XmlString
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("nametypeabebtype");
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.NameType newValue(java.lang.Object obj) {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) type.newValue( obj ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.NameType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.NameType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}

View File

@@ -0,0 +1,177 @@
/*
* An XML document type.
* Localname: todolist
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.TodolistDocument
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist;
/**
* A document containing one todolist(@http://xmlbeans.apache.org/samples/validation/todolist) element.
*
* This is a complex type.
*/
public interface TodolistDocument extends org.apache.xmlbeans.XmlObject
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("todolist637cdoctype");
/**
* Gets the "todolist" element
*/
org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist getTodolist();
/**
* Sets the "todolist" element
*/
void setTodolist(org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist todolist);
/**
* Appends and returns a new empty "todolist" element
*/
org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist addNewTodolist();
/**
* An XML todolist(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is a complex type.
*/
public interface Todolist extends org.apache.xmlbeans.XmlObject
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)schema.system.s59A663BF38731BA9F8026B121E40FDD3.TypeSystemHolder.typeSystem.resolveHandle("todolist39fcelemtype");
/**
* Gets array of all "item" elements
*/
org.apache.xmlbeans.samples.validation.todolist.ItemType[] getItemArray();
/**
* Gets ith "item" element
*/
org.apache.xmlbeans.samples.validation.todolist.ItemType getItemArray(int i);
/**
* Returns number of "item" element
*/
int sizeOfItemArray();
/**
* Sets array of all "item" element
*/
void setItemArray(org.apache.xmlbeans.samples.validation.todolist.ItemType[] itemArray);
/**
* Sets ith "item" element
*/
void setItemArray(int i, org.apache.xmlbeans.samples.validation.todolist.ItemType item);
/**
* Inserts and returns a new empty value (as xml) as the ith "item" element
*/
org.apache.xmlbeans.samples.validation.todolist.ItemType insertNewItem(int i);
/**
* Appends and returns a new empty value (as xml) as the last "item" element
*/
org.apache.xmlbeans.samples.validation.todolist.ItemType addNewItem();
/**
* Removes the ith "item" element
*/
void removeItem(int i);
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
private Factory() { } // No instance of this class allowed
}
}
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument newInstance() {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.samples.validation.todolist.TodolistDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}

View File

@@ -0,0 +1,26 @@
/*
* XML Type: actionType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.ActionType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist.impl;
/**
* An XML actionType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlString.
*/
public class ActionTypeImpl extends org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx implements org.apache.xmlbeans.samples.validation.todolist.ActionType
{
public ActionTypeImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType, false);
}
protected ActionTypeImpl(org.apache.xmlbeans.SchemaType sType, boolean b)
{
super(sType, b);
}
}

View File

@@ -0,0 +1,26 @@
/*
* XML Type: idType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.IdType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist.impl;
/**
* An XML idType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlInt.
*/
public class IdTypeImpl extends org.apache.xmlbeans.impl.values.JavaIntHolderEx implements org.apache.xmlbeans.samples.validation.todolist.IdType
{
public IdTypeImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType, false);
}
protected IdTypeImpl(org.apache.xmlbeans.SchemaType sType, boolean b)
{
super(sType, b);
}
}

View File

@@ -0,0 +1,445 @@
/*
* XML Type: itemType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.ItemType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist.impl;
/**
* An XML itemType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is a complex type.
*/
public class ItemTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.validation.todolist.ItemType
{
public ItemTypeImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName NAME$0 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "name");
private static final javax.xml.namespace.QName DESCRIPTION$2 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "description");
private static final javax.xml.namespace.QName DUEBY$4 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "due_by");
private static final javax.xml.namespace.QName ACTION$6 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "action");
private static final javax.xml.namespace.QName ID$8 =
new javax.xml.namespace.QName("", "id");
/**
* Gets the "name" element
*/
public java.lang.String getName()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
if (target == null)
{
return null;
}
return target.getStringValue();
}
}
/**
* Gets (as xml) the "name" element
*/
public org.apache.xmlbeans.XmlString xgetName()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NAME$0, 0);
return target;
}
}
/**
* Sets the "name" element
*/
public void setName(java.lang.String name)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NAME$0, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NAME$0);
}
target.setStringValue(name);
}
}
/**
* Sets (as xml) the "name" element
*/
public void xsetName(org.apache.xmlbeans.XmlString name)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NAME$0, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(NAME$0);
}
target.set(name);
}
}
/**
* Gets the "description" element
*/
public java.lang.String getDescription()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESCRIPTION$2, 0);
if (target == null)
{
return null;
}
return target.getStringValue();
}
}
/**
* Gets (as xml) the "description" element
*/
public org.apache.xmlbeans.XmlString xgetDescription()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DESCRIPTION$2, 0);
return target;
}
}
/**
* True if has "description" element
*/
public boolean isSetDescription()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(DESCRIPTION$2) != 0;
}
}
/**
* Sets the "description" element
*/
public void setDescription(java.lang.String description)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESCRIPTION$2, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DESCRIPTION$2);
}
target.setStringValue(description);
}
}
/**
* Sets (as xml) the "description" element
*/
public void xsetDescription(org.apache.xmlbeans.XmlString description)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DESCRIPTION$2, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DESCRIPTION$2);
}
target.set(description);
}
}
/**
* Unsets the "description" element
*/
public void unsetDescription()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(DESCRIPTION$2, 0);
}
}
/**
* Gets the "due_by" element
*/
public java.util.Calendar getDueBy()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DUEBY$4, 0);
if (target == null)
{
return null;
}
return target.getCalendarValue();
}
}
/**
* Gets (as xml) the "due_by" element
*/
public org.apache.xmlbeans.XmlDateTime xgetDueBy()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDateTime target = null;
target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(DUEBY$4, 0);
return target;
}
}
/**
* True if has "due_by" element
*/
public boolean isSetDueBy()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(DUEBY$4) != 0;
}
}
/**
* Sets the "due_by" element
*/
public void setDueBy(java.util.Calendar dueBy)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DUEBY$4, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DUEBY$4);
}
target.setCalendarValue(dueBy);
}
}
/**
* Sets (as xml) the "due_by" element
*/
public void xsetDueBy(org.apache.xmlbeans.XmlDateTime dueBy)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDateTime target = null;
target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(DUEBY$4, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(DUEBY$4);
}
target.set(dueBy);
}
}
/**
* Unsets the "due_by" element
*/
public void unsetDueBy()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(DUEBY$4, 0);
}
}
/**
* Gets the "action" element
*/
public org.apache.xmlbeans.samples.validation.todolist.ActionType.Enum getAction()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ACTION$6, 0);
if (target == null)
{
return null;
}
return (org.apache.xmlbeans.samples.validation.todolist.ActionType.Enum)target.getEnumValue();
}
}
/**
* Gets (as xml) the "action" element
*/
public org.apache.xmlbeans.samples.validation.todolist.ActionType xgetAction()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ActionType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ActionType)get_store().find_element_user(ACTION$6, 0);
return target;
}
}
/**
* Sets the "action" element
*/
public void setAction(org.apache.xmlbeans.samples.validation.todolist.ActionType.Enum action)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ACTION$6, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ACTION$6);
}
target.setEnumValue(action);
}
}
/**
* Sets (as xml) the "action" element
*/
public void xsetAction(org.apache.xmlbeans.samples.validation.todolist.ActionType action)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ActionType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ActionType)get_store().find_element_user(ACTION$6, 0);
if (target == null)
{
target = (org.apache.xmlbeans.samples.validation.todolist.ActionType)get_store().add_element_user(ACTION$6);
}
target.set(action);
}
}
/**
* Gets the "id" attribute
*/
public int getId()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$8);
if (target == null)
{
return 0;
}
return target.getIntValue();
}
}
/**
* Gets (as xml) the "id" attribute
*/
public org.apache.xmlbeans.samples.validation.todolist.IdType xgetId()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.IdType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.IdType)get_store().find_attribute_user(ID$8);
return target;
}
}
/**
* True if has "id" attribute
*/
public boolean isSetId()
{
synchronized (monitor())
{
check_orphaned();
return get_store().find_attribute_user(ID$8) != null;
}
}
/**
* Sets the "id" attribute
*/
public void setId(int id)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$8);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ID$8);
}
target.setIntValue(id);
}
}
/**
* Sets (as xml) the "id" attribute
*/
public void xsetId(org.apache.xmlbeans.samples.validation.todolist.IdType id)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.IdType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.IdType)get_store().find_attribute_user(ID$8);
if (target == null)
{
target = (org.apache.xmlbeans.samples.validation.todolist.IdType)get_store().add_attribute_user(ID$8);
}
target.set(id);
}
}
/**
* Unsets the "id" attribute
*/
public void unsetId()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_attribute(ID$8);
}
}
}

View File

@@ -0,0 +1,26 @@
/*
* XML Type: nameType
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.NameType
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist.impl;
/**
* An XML nameType(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is an atomic type that is a restriction of org.apache.xmlbeans.XmlString.
*/
public class NameTypeImpl extends org.apache.xmlbeans.impl.values.JavaStringHolderEx implements org.apache.xmlbeans.samples.validation.todolist.NameType
{
public NameTypeImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType, false);
}
protected NameTypeImpl(org.apache.xmlbeans.SchemaType sType, boolean b)
{
super(sType, b);
}
}

View File

@@ -0,0 +1,209 @@
/*
* An XML document type.
* Localname: todolist
* Namespace: http://xmlbeans.apache.org/samples/validation/todolist
* Java type: org.apache.xmlbeans.samples.validation.todolist.TodolistDocument
*
* Automatically generated - do not modify.
*/
package org.apache.xmlbeans.samples.validation.todolist.impl;
/**
* A document containing one todolist(@http://xmlbeans.apache.org/samples/validation/todolist) element.
*
* This is a complex type.
*/
public class TodolistDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.validation.todolist.TodolistDocument
{
public TodolistDocumentImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName TODOLIST$0 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "todolist");
/**
* Gets the "todolist" element
*/
public org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist getTodolist()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().find_element_user(TODOLIST$0, 0);
if (target == null)
{
return null;
}
return target;
}
}
/**
* Sets the "todolist" element
*/
public void setTodolist(org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist todolist)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().find_element_user(TODOLIST$0, 0);
if (target == null)
{
target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().add_element_user(TODOLIST$0);
}
target.set(todolist);
}
}
/**
* Appends and returns a new empty "todolist" element
*/
public org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist addNewTodolist()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist)get_store().add_element_user(TODOLIST$0);
return target;
}
}
/**
* An XML todolist(@http://xmlbeans.apache.org/samples/validation/todolist).
*
* This is a complex type.
*/
public static class TodolistImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.apache.xmlbeans.samples.validation.todolist.TodolistDocument.Todolist
{
public TodolistImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName ITEM$0 =
new javax.xml.namespace.QName("http://xmlbeans.apache.org/samples/validation/todolist", "item");
/**
* Gets array of all "item" elements
*/
public org.apache.xmlbeans.samples.validation.todolist.ItemType[] getItemArray()
{
synchronized (monitor())
{
check_orphaned();
java.util.List targetList = new java.util.ArrayList();
get_store().find_all_element_users(ITEM$0, targetList);
org.apache.xmlbeans.samples.validation.todolist.ItemType[] result = new org.apache.xmlbeans.samples.validation.todolist.ItemType[targetList.size()];
targetList.toArray(result);
return result;
}
}
/**
* Gets ith "item" element
*/
public org.apache.xmlbeans.samples.validation.todolist.ItemType getItemArray(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().find_element_user(ITEM$0, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
return target;
}
}
/**
* Returns number of "item" element
*/
public int sizeOfItemArray()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(ITEM$0);
}
}
/**
* Sets array of all "item" element
*/
public void setItemArray(org.apache.xmlbeans.samples.validation.todolist.ItemType[] itemArray)
{
synchronized (monitor())
{
check_orphaned();
arraySetterHelper(itemArray, ITEM$0);
}
}
/**
* Sets ith "item" element
*/
public void setItemArray(int i, org.apache.xmlbeans.samples.validation.todolist.ItemType item)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().find_element_user(ITEM$0, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
target.set(item);
}
}
/**
* Inserts and returns a new empty value (as xml) as the ith "item" element
*/
public org.apache.xmlbeans.samples.validation.todolist.ItemType insertNewItem(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().insert_element_user(ITEM$0, i);
return target;
}
}
/**
* Appends and returns a new empty value (as xml) as the last "item" element
*/
public org.apache.xmlbeans.samples.validation.todolist.ItemType addNewItem()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.samples.validation.todolist.ItemType target = null;
target = (org.apache.xmlbeans.samples.validation.todolist.ItemType)get_store().add_element_user(ITEM$0);
return target;
}
}
/**
* Removes the ith "item" element
*/
public void removeItem(int i)
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(ITEM$0, i);
}
}
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed 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.
-->
<todolist xmlns="http://xmlbeans.apache.org/samples/validation/todolist">
<item id="001">
<name>Buy a south Pacific island.</name>
<description>Contingent on inheriting lots of money.</description>
<due_by>2005-05-01T23:36:28</due_by>
<action>someday_maybe_defer</action>
</item>
<item id="002">
<name>Get that new PowerBook I've been eyeing.</name>
<description>Resulting productivity increase will be exponential!</description>
<due_by>2005-05-01T23:36:28</due_by>
<action>do</action>
</item>
<item id="003">
<name>Clean the garage.</name>
<description>Remove at least enough junk so that my bicycle fits.</description>
<due_by>2005-05-30T23:36:28</due_by>
<action>delegate</action>
</item>
</todolist>