1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.impl.dv.xs;
  23 
  24 import com.sun.org.apache.xerces.internal.impl.dv.DatatypeException;
  25 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
  26 import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
  27 import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
  28 import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
  29 import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
  30 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
  31 import com.sun.org.apache.xerces.internal.xs.StringList;
  32 import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
  33 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
  34 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
  35 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
  36 
  37 /**
  38  * Base class for XSSimpleType wrapper implementations.
  39  *
  40  * @xerces.internal
  41  *
  42  * @version $Id: XSSimpleTypeDelegate.java,v 1.3 2010-11-01 04:39:47 joehw Exp $
  43  */
  44 public class XSSimpleTypeDelegate
  45     implements XSSimpleType {
  46 
  47     protected final XSSimpleType type;
  48 
  49     public XSSimpleTypeDelegate(XSSimpleType type) {
  50         if (type == null) {
  51             throw new NullPointerException();
  52         }
  53         this.type = type;
  54     }
  55 
  56     public XSSimpleType getWrappedXSSimpleType() {
  57         return type;
  58     }
  59 
  60     public XSObjectList getAnnotations() {
  61         return type.getAnnotations();
  62     }
  63 
  64     public boolean getBounded() {
  65         return type.getBounded();
  66     }
  67 
  68     public short getBuiltInKind() {
  69         return type.getBuiltInKind();
  70     }
  71 
  72     public short getDefinedFacets() {
  73         return type.getDefinedFacets();
  74     }
  75 
  76     public XSObjectList getFacets() {
  77         return type.getFacets();
  78     }
  79 
  80     public boolean getFinite() {
  81         return type.getFinite();
  82     }
  83 
  84     public short getFixedFacets() {
  85         return type.getFixedFacets();
  86     }
  87 
  88     public XSSimpleTypeDefinition getItemType() {
  89         return type.getItemType();
  90     }
  91 
  92     public StringList getLexicalEnumeration() {
  93         return type.getLexicalEnumeration();
  94     }
  95 
  96     public String getLexicalFacetValue(short facetName) {
  97         return type.getLexicalFacetValue(facetName);
  98     }
  99 
 100     public StringList getLexicalPattern() {
 101         return type.getLexicalPattern();
 102     }
 103 
 104     public XSObjectList getMemberTypes() {
 105         return type.getMemberTypes();
 106     }
 107 
 108     public XSObjectList getMultiValueFacets() {
 109         return type.getMultiValueFacets();
 110     }
 111 
 112     public boolean getNumeric() {
 113         return type.getNumeric();
 114     }
 115 
 116     public short getOrdered() {
 117         return type.getOrdered();
 118     }
 119 
 120     public XSSimpleTypeDefinition getPrimitiveType() {
 121         return type.getPrimitiveType();
 122     }
 123 
 124     public short getVariety() {
 125         return type.getVariety();
 126     }
 127 
 128     public boolean isDefinedFacet(short facetName) {
 129         return type.isDefinedFacet(facetName);
 130     }
 131 
 132     public boolean isFixedFacet(short facetName) {
 133         return type.isFixedFacet(facetName);
 134     }
 135 
 136     public boolean derivedFrom(String namespace, String name, short derivationMethod) {
 137         return type.derivedFrom(namespace, name, derivationMethod);
 138     }
 139 
 140     public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod) {
 141         return type.derivedFromType(ancestorType, derivationMethod);
 142     }
 143 
 144     public boolean getAnonymous() {
 145         return type.getAnonymous();
 146     }
 147 
 148     public XSTypeDefinition getBaseType() {
 149         return type.getBaseType();
 150     }
 151 
 152     public short getFinal() {
 153         return type.getFinal();
 154     }
 155 
 156     public short getTypeCategory() {
 157         return type.getTypeCategory();
 158     }
 159 
 160     public boolean isFinal(short restriction) {
 161         return type.isFinal(restriction);
 162     }
 163 
 164     public String getName() {
 165         return type.getName();
 166     }
 167 
 168     public String getNamespace() {
 169         return type.getNamespace();
 170     }
 171 
 172     public XSNamespaceItem getNamespaceItem() {
 173         return type.getNamespaceItem();
 174     }
 175 
 176     public short getType() {
 177         return type.getType();
 178     }
 179 
 180     public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
 181         throws InvalidDatatypeFacetException {
 182         type.applyFacets(facets, presentFacet, fixedFacet, context);
 183     }
 184 
 185     public short getPrimitiveKind() {
 186         return type.getPrimitiveKind();
 187     }
 188 
 189     public short getWhitespace() throws DatatypeException {
 190         return type.getWhitespace();
 191     }
 192 
 193     public boolean isEqual(Object value1, Object value2) {
 194         return type.isEqual(value1, value2);
 195     }
 196 
 197     public boolean isIDType() {
 198         return type.isIDType();
 199     }
 200 
 201     public void validate(ValidationContext context, ValidatedInfo validatedInfo)
 202         throws InvalidDatatypeValueException {
 203         type.validate(context, validatedInfo);
 204     }
 205 
 206     public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
 207         throws InvalidDatatypeValueException {
 208         return type.validate(content, context, validatedInfo);
 209     }
 210 
 211     public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
 212         throws InvalidDatatypeValueException {
 213         return type.validate(content, context, validatedInfo);
 214     }
 215 
 216     public String toString() {
 217         return type.toString();
 218     }
 219 }