001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.axis2.schema;
020:
021: import org.apache.axis2.namespace.Constants;
022:
023: import javax.xml.namespace.QName;
024:
025: /**
026: * Constants for the QNames of standard schema types
027: */
028: public class SchemaConstants {
029:
030: public static final String URI_DEFAULT_SCHEMA_XSD = Constants.URI_2001_SCHEMA_XSD;
031: public static final QName XSD_STRING = new QName(
032: URI_DEFAULT_SCHEMA_XSD, "string");
033: public static final QName XSD_BOOLEAN = new QName(
034: URI_DEFAULT_SCHEMA_XSD, "boolean");
035: public static final QName XSD_DOUBLE = new QName(
036: URI_DEFAULT_SCHEMA_XSD, "double");
037: public static final QName XSD_FLOAT = new QName(
038: URI_DEFAULT_SCHEMA_XSD, "float");
039: public static final QName XSD_INT = new QName(
040: URI_DEFAULT_SCHEMA_XSD, "int");
041: public static final QName XSD_INTEGER = new QName(
042: URI_DEFAULT_SCHEMA_XSD, "integer");
043: public static final QName XSD_LONG = new QName(
044: URI_DEFAULT_SCHEMA_XSD, "long");
045: public static final QName XSD_SHORT = new QName(
046: URI_DEFAULT_SCHEMA_XSD, "short");
047: public static final QName XSD_BYTE = new QName(
048: URI_DEFAULT_SCHEMA_XSD, "byte");
049: public static final QName XSD_DECIMAL = new QName(
050: URI_DEFAULT_SCHEMA_XSD, "decimal");
051: public static final QName XSD_BASE64 = new QName(
052: URI_DEFAULT_SCHEMA_XSD, "base64Binary");
053: public static final QName XSD_HEXBIN = new QName(
054: URI_DEFAULT_SCHEMA_XSD, "hexBinary");
055: public static final QName XSD_ANYSIMPLETYPE = new QName(
056: URI_DEFAULT_SCHEMA_XSD, "anySimpleType");
057: public static final QName XSD_ANYTYPE = new QName(
058: URI_DEFAULT_SCHEMA_XSD, "anyType");
059: public static final QName XSD_ANY = new QName(
060: URI_DEFAULT_SCHEMA_XSD, "any");
061: public static final QName XSD_QNAME = new QName(
062: URI_DEFAULT_SCHEMA_XSD, "QName");
063: public static final QName XSD_DATETIME = new QName(
064: URI_DEFAULT_SCHEMA_XSD, "dateTime");
065: public static final QName XSD_DATE = new QName(
066: URI_DEFAULT_SCHEMA_XSD, "date");
067: public static final QName XSD_TIME = new QName(
068: URI_DEFAULT_SCHEMA_XSD, "time");
069:
070: public static final QName XSD_UNSIGNEDLONG = new QName(
071: URI_DEFAULT_SCHEMA_XSD, "unsignedLong");
072: public static final QName XSD_UNSIGNEDINT = new QName(
073: URI_DEFAULT_SCHEMA_XSD, "unsignedInt");
074: public static final QName XSD_UNSIGNEDSHORT = new QName(
075: URI_DEFAULT_SCHEMA_XSD, "unsignedShort");
076: public static final QName XSD_UNSIGNEDBYTE = new QName(
077: URI_DEFAULT_SCHEMA_XSD, "unsignedByte");
078: public static final QName XSD_POSITIVEINTEGER = new QName(
079: URI_DEFAULT_SCHEMA_XSD, "positiveInteger");
080: public static final QName XSD_NEGATIVEINTEGER = new QName(
081: URI_DEFAULT_SCHEMA_XSD, "negativeInteger");
082: public static final QName XSD_NONNEGATIVEINTEGER = new QName(
083: URI_DEFAULT_SCHEMA_XSD, "nonNegativeInteger");
084: public static final QName XSD_NONPOSITIVEINTEGER = new QName(
085: URI_DEFAULT_SCHEMA_XSD, "nonPositiveInteger");
086:
087: public static final QName XSD_YEARMONTH = new QName(
088: URI_DEFAULT_SCHEMA_XSD, "gYearMonth");
089: public static final QName XSD_MONTHDAY = new QName(
090: URI_DEFAULT_SCHEMA_XSD, "gMonthDay");
091: public static final QName XSD_YEAR = new QName(
092: URI_DEFAULT_SCHEMA_XSD, "gYear");
093: public static final QName XSD_MONTH = new QName(
094: URI_DEFAULT_SCHEMA_XSD, "gMonth");
095: public static final QName XSD_DAY = new QName(
096: URI_DEFAULT_SCHEMA_XSD, "gDay");
097: public static final QName XSD_DURATION = new QName(
098: URI_DEFAULT_SCHEMA_XSD, "duration");
099:
100: public static final QName XSD_NAME = new QName(
101: URI_DEFAULT_SCHEMA_XSD, "Name");
102: public static final QName XSD_NCNAME = new QName(
103: URI_DEFAULT_SCHEMA_XSD, "NCName");
104: public static final QName XSD_NMTOKEN = new QName(
105: URI_DEFAULT_SCHEMA_XSD, "NMTOKEN");
106: public static final QName XSD_NMTOKENS = new QName(
107: URI_DEFAULT_SCHEMA_XSD, "NMTOKENS");
108: public static final QName XSD_NOTATION = new QName(
109: URI_DEFAULT_SCHEMA_XSD, "NOTATION");
110: public static final QName XSD_ENTITY = new QName(
111: URI_DEFAULT_SCHEMA_XSD, "ENTITY");
112: public static final QName XSD_ENTITIES = new QName(
113: URI_DEFAULT_SCHEMA_XSD, "ENTITIES");
114: public static final QName XSD_IDREF = new QName(
115: URI_DEFAULT_SCHEMA_XSD, "IDREF");
116: public static final QName XSD_IDREFS = new QName(
117: URI_DEFAULT_SCHEMA_XSD, "IDREFS");
118: public static final QName XSD_ANYURI = new QName(
119: URI_DEFAULT_SCHEMA_XSD, "anyURI");
120: public static final QName XSD_LANGUAGE = new QName(
121: URI_DEFAULT_SCHEMA_XSD, "language");
122: public static final QName XSD_ID = new QName(
123: URI_DEFAULT_SCHEMA_XSD, "ID");
124: public static final QName XSD_SCHEMA = new QName(
125: URI_DEFAULT_SCHEMA_XSD, "schema");
126:
127: public static final QName XSD_NORMALIZEDSTRING = new QName(
128: URI_DEFAULT_SCHEMA_XSD, "normalizedString");
129: public static final QName XSD_TOKEN = new QName(
130: URI_DEFAULT_SCHEMA_XSD, "token");
131:
132: //bit patterns for the types
133: public static final int ATTRIBUTE_TYPE = 0x0001;
134: public static final int ELEMENT_TYPE = 0x0002;
135: public static final int ARRAY_TYPE = 0x0004;
136: public static final int ANY_TYPE = 0x0008;
137: public static final int BINARY_TYPE = 0x0010;
138: public static final int OPTIONAL_TYPE = 0x0020;
139: public static final int SIMPLE_TYPE_OR_CONTENT = 0x0040;
140: public static final int INNER_CHOICE_ELEMENT = 0x0080;
141: public static final int PARTICLE_TYPE_ELEMENT = 0x0100;
142:
143: public static class SchemaPropertyNames {
144:
145: public static final String SCHEMA_COMPILER_PROPERTIES = "/org/apache/axis2/schema/schema-compile.properties";
146: public static final String BEAN_WRITER_KEY = "schema.bean.writer.class";
147: public static final String BEAN_WRITER_TEMPLATE_KEY = "schema.bean.writer.template";
148: public static final String BEAN_WRITER_TYPEMAP_KEY = "schema.bean.typemap";
149: }
150:
151: public static class SchemaCompilerArguments {
152:
153: public static final String WRAP_SCHEMA_CLASSES = "w";
154: public static final String WRITE_SCHEMA_CLASSES = "r";
155: public static final String STYLE = "s";
156: public static final String PACKAGE = "p";
157: public static final String MAPPER_PACKAGE = "mp";
158: public static final String HELPER_MODE = "h";
159: public static final String OFF_STRICT_VALIDATION = "osv";
160:
161: }
162:
163: public static class SchemaCompilerInfoHolder {
164: public static final String CLASSNAME_KEY = "CLASS_NAME";
165: public static final String CLASSNAME_PRIMITVE_KEY = "CLASS_NAME_PRIMITIVE";
166: public static final String FAKE_QNAME = "Q_NAME";
167: }
168: }
|