KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > validation > Schema


1 // $Id: Schema.java,v 1.4 2003/12/06 00:21:36 jsuttor Exp $
2

3 /*
4  * @(#)Schema.java 1.5 04/07/26
5  *
6  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
7  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
8  */

9
10 package javax.xml.validation;
11
12 /**
13  * Immutable in-memory representation of grammar.
14  *
15  * <p>
16  * This object represents a set of constraints that can be checked/
17  * enforced against an XML document.
18  *
19  * <p>
20  * A {@link Schema} object is thread safe and applications are
21  * encouraged to share it across many parsers in many threads.
22  *
23  * <p>
24  * A {@link Schema} object is immutable in the sense that it shouldn't
25  * change the set of constraints once it is created. In other words,
26  * if an application validates the same document twice against the same
27  * {@link Schema}, it must always produce the same result.
28  *
29  * <p>
30  * A {@link Schema} object is usually created from {@link SchemaFactory}.
31  *
32  * <p>
33  * Two kinds of validators can be created from a {@link Schema} object.
34  * One is {@link Validator}, which provides highly-level validation
35  * operations that cover typical use cases. The other is
36  * {@link ValidatorHandler}, which works on top of SAX for better
37  * modularity.
38  *
39  * <p>
40  * This specification does not refine
41  * the {@link java.lang.Object#equals(java.lang.Object)} method.
42  * In other words, if you parse the same schema twice, you may
43  * still get <code>!schemaA.equals(schemaB)</code>.
44  *
45  * @author <a HREF="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
46  * @version $Revision: 1.4 $, $Date: 2003/12/06 00:21:36 $
47  * @see <a HREF="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a>
48  * @see <a HREF="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a>
49  * @see <a HREF="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a>
50  * @since 1.5
51  */

52 public abstract class Schema {
53     
54     /**
55      * Constructor for the derived class.
56      *
57      * <p>
58      * The constructor does nothing.
59      */

60     protected Schema() {
61     }
62     
63     /**
64      * Creates a new {@link Validator} for this {@link Schema}.
65      *
66      * <p>
67      * A validator enforces/checks the set of constraints this object
68      * represents.
69      *
70      * @return
71      * Always return a non-null valid object.
72      */

73     public abstract Validator JavaDoc newValidator();
74     
75     /**
76      * Creates a new {@link ValidatorHandler} for this {@link Schema}.
77      *
78      * @return
79      * Always return a non-null valid object.
80      */

81     public abstract ValidatorHandler JavaDoc newValidatorHandler();
82 }
83
Popular Tags