KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > types > AbstractBuiltinType


1 /*
2  * Copyright 2003,2004 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.jaxme.xs.types;
18
19 import org.apache.ws.jaxme.xs.XSAnnotation;
20 import org.apache.ws.jaxme.xs.XSSchema;
21 import org.apache.ws.jaxme.xs.XSType;
22 import org.apache.ws.jaxme.xs.xml.XsSchemaHeader;
23 import org.xml.sax.Attributes JavaDoc;
24 import org.xml.sax.Locator JavaDoc;
25 import org.xml.sax.SAXException JavaDoc;
26 import org.xml.sax.helpers.AttributesImpl JavaDoc;
27
28 /** <p>An abstract type, to be extended by the builtin types.</p>
29  *
30  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
31  */

32 public abstract class AbstractBuiltinType implements XSType {
33   private static final Attributes JavaDoc openAttrs = new AttributesImpl JavaDoc();
34   private static final XSAnnotation[] annotations = new XSAnnotation[0];
35   
36   public Attributes JavaDoc getOpenAttributes() { return openAttrs; }
37   public XSAnnotation[] getAnnotations() { return annotations; }
38   public boolean isGlobal() { return true; }
39   public XSSchema getXSSchema() { return null; }
40   
41   public void setGlobal(boolean pGlobal) {
42     if (pGlobal == false) {
43       throw new IllegalStateException JavaDoc("A builtin type cannot be local.");
44     }
45   }
46
47   public Locator JavaDoc getLocator() {
48     throw new IllegalStateException JavaDoc("The builtin type " + getName() + " does not have a location.");
49   }
50
51   public void validate() throws SAXException JavaDoc {}
52 public XsSchemaHeader getSchemaHeader() {
53     return null;
54   }
55 }
56
Popular Tags