KickJava   Java API By Example, From Geeks To Geeks.

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


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.XSAttributable;
20 import org.apache.ws.jaxme.xs.XSComplexType;
21 import org.apache.ws.jaxme.xs.XSObject;
22 import org.apache.ws.jaxme.xs.XSParser;
23 import org.apache.ws.jaxme.xs.XSParticle;
24 import org.apache.ws.jaxme.xs.XSSimpleContentType;
25 import org.apache.ws.jaxme.xs.XSSimpleType;
26 import org.apache.ws.jaxme.xs.XSType;
27 import org.apache.ws.jaxme.xs.xml.XsComplexContentType;
28 import org.apache.ws.jaxme.xs.xml.XsQName;
29 import org.xml.sax.SAXException JavaDoc;
30
31
32 /** <p>The "anyType" is a type with arbitrary content.</p>
33  *
34  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
35  */

36 public class XSAnyType extends AbstractBuiltinType
37     implements XSComplexType {
38   private static final XsQName qName = new XsQName(XSParser.XML_SCHEMA_URI, "anyType", null);
39   private static final XSAttributable[] attributes = new XSAttributable[0];
40   private static final XSAnyType theInstance = new XSAnyType();
41
42   private XSAnyType() {
43   }
44
45   public static final XSAnyType getInstance() {
46     return theInstance;
47   }
48
49   public boolean isSimple() { return false; }
50   public XSSimpleType getSimpleType() throws SAXException JavaDoc {
51     throw new IllegalStateException JavaDoc("The anyType is a complex type.");
52   }
53   public XSComplexType getComplexType() throws SAXException JavaDoc { return this; }
54   public XsQName getName() { return qName; }
55   public boolean isTopLevelObject() { return true; }
56   public XSObject getParentObject() { return null; }
57   public boolean hasSimpleContent() { return false; }
58   public boolean isEmpty() { return false; }
59   public boolean isElementOnly() { return false; }
60   public boolean isMixed() { return true; }
61   public XSParticle getParticle() { return null; }
62   public XSAttributable[] getAttributes() { return attributes; }
63   public boolean isExtension() { return false; }
64   public XSType getExtendedType() { return null; }
65   public boolean isRestriction() { return false; }
66   public XSType getRestrictedType() { return null; }
67     
68   public XsComplexContentType getComplexContentType() {
69     throw new IllegalStateException JavaDoc("The builtin type " + getName() + " does not have an inner instance of XsComplexContentType.");
70   }
71
72   public XSSimpleContentType getSimpleContent() {
73     throw new IllegalStateException JavaDoc("The builtin type " + getName() + " does not have simple content.");
74   }
75
76   public boolean isBuiltin() { return true; }
77 }
78
Popular Tags