/projects/jre-1.6.0/src/javax/xml/validation/Schema.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus · Java · 107 lines · 7 code · 6 blank · 94 comment · 0 complexity · f6de2e4b5ea356547ba566a710426aec MD5 · raw file

  1. /*
  2. * The contents of this file are subject to the terms
  3. * of the Common Development and Distribution License
  4. * (the "License"). You may not use this file except
  5. * in compliance with the License.
  6. *
  7. * You can obtain a copy of the license at
  8. * https://jaxp.dev.java.net/CDDLv1.0.html.
  9. * See the License for the specific language governing
  10. * permissions and limitations under the License.
  11. *
  12. * When distributing Covered Code, include this CDDL
  13. * HEADER in each file and include the License file at
  14. * https://jaxp.dev.java.net/CDDLv1.0.html
  15. * If applicable add the following below this CDDL HEADER
  16. * with the fields enclosed by brackets "[]" replaced with
  17. * your own identifying information: Portions Copyright
  18. * [year] [name of copyright owner]
  19. */
  20. /*
  21. * $Id: XMLEntityReader.java,v 1.3 2005/11/03 17:02:21 jeffsuttor Exp $
  22. * %W% %E%
  23. *
  24. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  25. */
  26. package javax.xml.validation;
  27. /**
  28. * Immutable in-memory representation of grammar.
  29. *
  30. * <p>
  31. * This object represents a set of constraints that can be checked/
  32. * enforced against an XML document.
  33. *
  34. * <p>
  35. * A {@link Schema} object is thread safe and applications are
  36. * encouraged to share it across many parsers in many threads.
  37. *
  38. * <p>
  39. * A {@link Schema} object is immutable in the sense that it shouldn't
  40. * change the set of constraints once it is created. In other words,
  41. * if an application validates the same document twice against the same
  42. * {@link Schema}, it must always produce the same result.
  43. *
  44. * <p>
  45. * A {@link Schema} object is usually created from {@link SchemaFactory}.
  46. *
  47. * <p>
  48. * Two kinds of validators can be created from a {@link Schema} object.
  49. * One is {@link Validator}, which provides highly-level validation
  50. * operations that cover typical use cases. The other is
  51. * {@link ValidatorHandler}, which works on top of SAX for better
  52. * modularity.
  53. *
  54. * <p>
  55. * This specification does not refine
  56. * the {@link java.lang.Object#equals(java.lang.Object)} method.
  57. * In other words, if you parse the same schema twice, you may
  58. * still get <code>!schemaA.equals(schemaB)</code>.
  59. *
  60. * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
  61. * @version $Revision: 1.3 $, $Date: 2005/10/12 17:14:21 $
  62. * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a>
  63. * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a>
  64. * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a>
  65. * @since 1.5
  66. */
  67. public abstract class Schema {
  68. /**
  69. * Constructor for the derived class.
  70. *
  71. * <p>
  72. * The constructor does nothing.
  73. */
  74. protected Schema() {
  75. }
  76. /**
  77. * Creates a new {@link Validator} for this {@link Schema}.
  78. *
  79. * <p>A validator enforces/checks the set of constraints this object
  80. * represents.</p>
  81. *
  82. * <p>Implementors should assure that the properties set on the
  83. * {@link SchemaFactory} that created this {@link Schema} are also
  84. * set on the {@link Validator} constructed.</p>
  85. *
  86. * @return
  87. * Always return a non-null valid object.
  88. */
  89. public abstract Validator newValidator();
  90. /**
  91. * Creates a new {@link ValidatorHandler} for this {@link Schema}.
  92. *
  93. * <p>Implementors should assure that the properties set on the
  94. * {@link SchemaFactory} that created this {@link Schema} are also
  95. * set on the {@link ValidatorHandler} constructed.</p>
  96. *
  97. * @return
  98. * Always return a non-null valid object.
  99. */
  100. public abstract ValidatorHandler newValidatorHandler();
  101. }