View Javadoc

1   /*
2    * Copyright 2004,2007 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.ws.commons.schema;
18  
19  import javax.xml.namespace.QName;
20  
21  
22  /**
23   * Class for simple types that are derived by restriction. Restricts the
24   * range of values for the element to a subset of the inherited simple types.
25   * Represents the World Wide Web Consortium (W3C) restriction element for simple content.
26   */
27  
28  public class XmlSchemaSimpleContentRestriction extends XmlSchemaContent {
29  
30      /**
31       * Creates new XmlSchemaSimpleContentRestriction
32       */
33      public XmlSchemaSimpleContentRestriction() {
34          facets = new XmlSchemaObjectCollection();
35          attributes = new XmlSchemaObjectCollection();
36      }
37  
38      /* Allows an XmlSchemaAnyAttribute to be used for the attribute value.*/
39      XmlSchemaAnyAttribute anyAttribute;
40  
41      public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) {
42          this.anyAttribute = anyAttribute;
43      }
44  
45      public XmlSchemaAnyAttribute getAnyAttribute() {
46          return this.anyAttribute;
47      }
48  
49      /* Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple type.*/
50      XmlSchemaObjectCollection attributes;
51  
52      public XmlSchemaObjectCollection getAttributes() {
53          return this.attributes;
54      }
55  
56      /*Derived from the type specified by the base value.*/
57      XmlSchemaSimpleType baseType;
58  
59      public void setBaseType(XmlSchemaSimpleType baseType) {
60          this.baseType = baseType;
61      }
62  
63      public XmlSchemaSimpleType getBaseType() {
64          return this.baseType;
65      }
66  
67      /* Name of the built-in data type, simple type, or complex type.*/
68      QName baseTypeName;
69  
70      public void setBaseTypeName(QName baseTypeName) {
71          this.baseTypeName = baseTypeName;
72      }
73  
74      public QName getBaseTypeName() {
75          return this.baseTypeName;
76      }
77  
78      /* One or more of the facet classes: */
79      XmlSchemaObjectCollection facets;
80  
81      public XmlSchemaObjectCollection getFacets() {
82          return this.facets;
83      }
84  
85  }
86