KickJava   Java API By Example, From Geeks To Geeks.

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


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.XSAtomicType;
20 import org.apache.ws.jaxme.xs.XSEnumeration;
21 import org.apache.ws.jaxme.xs.XSComplexType;
22 import org.apache.ws.jaxme.xs.XSListType;
23 import org.apache.ws.jaxme.xs.XSObject;
24 import org.apache.ws.jaxme.xs.XSObjectFactory;
25 import org.apache.ws.jaxme.xs.XSSimpleType;
26 import org.apache.ws.jaxme.xs.XSUnionType;
27
28
29 /**
30  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
31  */

32 public abstract class AbstractSimpleType extends AbstractBuiltinType implements XSSimpleType {
33   public boolean isSimple() { return true; }
34   public boolean isAtomic() { return false; }
35   public boolean isList() { return false; }
36   public boolean isUnion() { return false; }
37   public XSSimpleType getSimpleType() { return this; }
38   public String JavaDoc[][] getPattern() { return null; }
39   public XSEnumeration[] getEnumerations() { return new XSEnumeration[0]; }
40   public XSObject getParentObject() {
41     throw new IllegalStateException JavaDoc("The " + getName() +
42                                      " type is declared outside of any schema and doesn't have a parent.");
43   }
44   public boolean isTopLevelObject() { return true; }
45
46   public XSComplexType getComplexType() {
47     throw new IllegalStateException JavaDoc("This is a complex type.");
48   }
49
50   public XSAtomicType getAtomicType() {
51     throw new IllegalStateException JavaDoc("The type " + getName() + " is not atomic.");
52   }
53
54   public XSListType getListType() {
55     throw new IllegalStateException JavaDoc("The global type " + getName() + " is no list type.");
56   }
57
58   public XSUnionType getUnionType() {
59     throw new IllegalStateException JavaDoc("The global type " + getName() + " is no union type.");
60   }
61
62   public XSObjectFactory getXSObjectFactory() {
63     throw new IllegalStateException JavaDoc("The global type " + getName() + " does not have an object factory.");
64   }
65 }
66
Popular Tags