You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mirae-dev@ws.apache.org by da...@apache.org on 2005/02/03 13:41:11 UTC
svn commit: r151149 [6/19] - in webservices/mirae/trunk: ./ bin/ bin/linux/
bin/windows/ build/ docs/ docs/images/ docs/images/CVS/ docs/javadoc/
genstub/ genstub/example8/ genstub/lk/ genstub/lk/opensource/
genstub/lk/opensource/wsmobile/ genstub/org/ genstub/org/apache/
genstub/org/apache/mirae/ genstub/org/apache/mirae/builtin/
genstub/org/apache/mirae/builtin/simpletypes/ genstub/uk/ genstub/uk/co/
genstub/uk/co/dsdata/ genstub/uk/co/dsdata/ws/
genstub/uk/co/dsdata/ws/travel/ genstub/uk/co/dsdata/ws/travel/sbg/
genstub/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/
genstub/ws_mobile_point/ lib/ logs/ samples/ samples/documentsamples/
samples/documentsamples/calculator/
samples/documentsamples/calculator/calculator/
samples/documentsamples/calculator/calculator/axis/
samples/documentsamples/calculator/calculator/axis/localhost/
samples/documentsamples/calculator/org/
samples/documentsamples/calculator/org/apache/
samples/documentsamples/calculator/org/apache/mirae/
samples/documentsamples/calculator/org/apache/mirae/builtin/
samples/documentsamples/calculator/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/echo/ samples/documentsamples/echo/org/
samples/documentsamples/echo/org/apache/
samples/documentsamples/echo/org/apache/mirae/
samples/documentsamples/echo/org/apache/mirae/builtin/
samples/documentsamples/echo/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/echo/org/soapinterop/
samples/documentsamples/employee/
samples/documentsamples/employee/jSR172UseCases/
samples/documentsamples/employee/jSR172UseCases/com/
samples/documentsamples/employee/jSR172UseCases/com/sun/
samples/documentsamples/employee/jSR172UseCases/com/sun/www/
samples/documentsamples/employee/org/
samples/documentsamples/employee/org/apache/
samples/documentsamples/employee/org/apache/mirae/
samples/documentsamples/employee/org/apache/mirae/builtin/
samples/documentsamples/employee/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/employee/xsd/
samples/documentsamples/employee/xsd/JSR172AppendixA/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/sun/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/sun/www/
samples/rpcsamples/ samples/rpcsamples/airfarequote/
samples/rpcsamples/airfarequote/org/
samples/rpcsamples/airfarequote/org/apache/
samples/rpcsamples/airfarequote/org/apache/mirae/
samples/rpcsamples/airfarequote/org/apache/mirae/builtin/
samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/airfarequote/uk/ samples/rpcsamples/airfarequote/uk/co/
samples/rpcsamples/airfarequote/uk/co/dsdata/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/
samples/rpcsamples/calculator/ samples/rpcsamples/calculator/lk/
samples/rpcsamples/calculator/lk/opensource/
samples/rpcsamples/calculator/lk/opensource/wsmobile/
samples/rpcsamples/calculator/org/ samples/rpcsamples/calculator/org/apache/
samples/rpcsamples/calculator/org/apache/mirae/
samples/rpcsamples/calculator/org/apache/mirae/builtin/
samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/distance/ samples/rpcsamples/distance/org/
samples/rpcsamples/distance/org/apache/
samples/rpcsamples/distance/org/apache/mirae/
samples/rpcsamples/distance/org/apache/mirae/builtin/
samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/distance/wsdl/
samples/rpcsamples/distance/wsdl/DistanceService/
samples/rpcsamples/distance/wsdl/DistanceService/sd/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/
samples/rpcsamples/point/ samples/rpcsamples/point/org/
samples/rpcsamples/point/org/apache/
samples/rpcsamples/point/org/apache/mirae/
samples/rpcsamples/point/org/apache/mirae/builtin/
samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/point/ws_mobile_point/ samples/rpcsamples/student/
samples/rpcsamples/student/example8/ samples/rpcsamples/student/org/
samples/rpcsamples/student/org/apache/
samples/rpcsamples/student/org/apache/mirae/
samples/rpcsamples/student/org/apache/mirae/builtin/
samples/rpcsamples/student/org/apache/mirae/builtin/simpletypes/ src/
src/mirae/ src/mirae/jaxp/ src/mirae/jaxp/javax/ src/mirae/jaxp/javax/xml/
src/mirae/jaxp/javax/xml/parsers/ src/mirae/jaxp/org/
src/mirae/jaxp/org/apache/ src/mirae/jaxp/org/apache/mirae/
src/mirae/jaxp/org/apache/mirae/j2me/
src/mirae/jaxp/org/apache/mirae/j2me/xml/
src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/ src/mirae/jaxp/org/xml/
src/mirae/jaxp/org/xml/sax/ src/mirae/jaxp/org/xml/sax/helpers/
src/mirae/jaxrpc/ src/mirae/jaxrpc/javax/ src/mirae/jaxrpc/javax/xml/
src/mirae/jaxrpc/javax/xml/namespace/ src/mirae/jaxrpc/javax/xml/rpc/
src/mirae/jaxrpc/org/ src/mirae/jaxrpc/org/apache/
src/mirae/jaxrpc/org/apache/mirae/ src/mirae/jaxrpc/org/apache/mirae/util/
src/mirae/jaxrpc/org/apache/mirae/xml/
src/mirae/jaxrpc/org/apache/mirae/xml/rpc/ src/tools/
src/tools/simpletypes/ src/tools/wsdl2ws_j2me/ src/tools/wsdl2ws_j2me/org/
src/tools/wsdl2ws_j2me/org/apache/ src/tools/wsdl2ws_j2me/org/apache/axis/
src/tools/wsdl2ws_j2me/org/apache/axis/wsdl/
src/tools/wsdl2ws_j2me/org/apache/axis/wsdl/symbolTable/
src/tools/wsdl2ws_j2me/org/apache/mirae/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/doclit/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/info/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/j2me/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/j2me/client/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/rpc/ tests/
tests/functional/ tests/functional/client/
tests/functional/client/SBGGetAirFareQuote-client1/
tests/functional/client/SBGGetAirFareQuote-client2/
tests/functional/client/calculator/ tests/functional/client/point/
tests/functional/client/wst/ tests/functional/wsdl/ tests/unit/
tests/unit/inmessage/ tests/unit/mirae/ tests/unit/outmessage/
tests/unit/wsdl2ws/ wsdl/ wsdltests/ wsdltests/calculator/
wsdltests/calculator/client/ wsdltests/calculator/server/
wsdltests/exceptiontest/ wsdltests/exceptiontest/client/
wsdltests/exceptiontest/server/ wsdltests/interoptestround1/
wsdltests/interoptestround1/client/ wsdltests/interoptestround1/server/
Added: webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/LocatorImpl.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/LocatorImpl.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/LocatorImpl.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/LocatorImpl.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mirae.j2me.xml.sax;
+
+import org.xml.sax.Locator;
+
+/**
+ * This is an implementation of org.xml.sax.Locator
+ * @author Ias (iasandcb@tmax.co.kr)
+ *
+ */
+public class LocatorImpl implements Locator {
+
+ private String publicId;
+ private String systemId;
+ private int lineNumber;
+ private int columnNumber;
+ private int previousColumnNumber;
+
+ public LocatorImpl(String publicId, String systemId, int lineNumber, int columnNumber) {
+ this.publicId = publicId;
+ this.systemId = systemId;
+ this.lineNumber = lineNumber;
+ this.columnNumber = columnNumber;
+ }
+ /**
+ * @see org.xml.sax.Locator#getPublicId()
+ */
+ public String getPublicId() {
+ return publicId;
+ }
+
+ /**
+ * @see org.xml.sax.Locator#getSystemId()
+ */
+ public String getSystemId() {
+ return systemId;
+ }
+
+ /**
+ * @see org.xml.sax.Locator#getLineNumber()
+ */
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ /**
+ * @see org.xml.sax.Locator#getColumnNumber()
+ */
+ public int getColumnNumber() {
+ return columnNumber;
+ }
+
+ /**
+ * increase column number by 1
+ *
+ */
+ public void incrementColumnNumber() {
+ columnNumber++;
+ }
+
+ /**
+ * increase column number by increment
+ *
+ */
+
+ public void addColumnNumber(int increment) {
+ columnNumber += increment;
+ }
+
+ /**
+ * increase line number by 1
+ */
+
+ public void incrementLineNumber() {
+ lineNumber++;
+ previousColumnNumber = columnNumber;
+ columnNumber = 0;
+ }
+
+ /**
+ * decrease line number by 1
+ *
+ */
+ public void decrementLineNumber() {
+ lineNumber--;
+ columnNumber = previousColumnNumber;
+ }
+}
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Attributes.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Attributes.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Attributes.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Attributes.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,250 @@
+// Attributes.java - attribute list with Namespace support
+// http://www.saxproject.org
+// Written by David Megginson
+// NO WARRANTY! This class is in the public domain.
+
+// $Id: Attributes.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+
+package org.xml.sax;
+
+
+/**
+ * Interface for a list of XML attributes.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>This interface allows access to a list of attributes in
+ * three different ways:</p>
+ *
+ * <ol>
+ * <li>by attribute index;</li>
+ * <li>by Namespace-qualified name; or</li>
+ * <li>by qualified (prefixed) name.</li>
+ * </ol>
+ *
+ * <p>The list will not contain attributes that were declared
+ * #IMPLIED but not specified in the start tag. It will also not
+ * contain attributes used as Namespace declarations (xmlns*) unless
+ * the <code>http://xml.org/sax/features/namespace-prefixes</code>
+ * feature is set to <var>true</var> (it is <var>false</var> by
+ * default).
+ * Because SAX2 conforms to the "Namespaces in XML" specification,
+ * it does not give namespace declaration attributes a namespace URI.
+ * Some other W3C specifications are in conflict with that, expecting
+ * these declarations to be in a namespace.
+ * Handler code may need to resolve that conflict.
+ * </p>
+ *
+ * <p>If the namespace-prefixes feature (see above) is <var>false</var>,
+ * access by qualified name may not be available; if the
+ * <code>http://xml.org/sax/features/namespaces</code>
+ * feature is <var>false</var>, access by Namespace-qualified names
+ * may not be available.</p>
+ *
+ * <p>This interface replaces the now-deprecated SAX1 {@link
+ * org.xml.sax.AttributeList AttributeList} interface, which does not
+ * contain Namespace support. In addition to Namespace support, it
+ * adds the <var>getIndex</var> methods (below).</p>
+ *
+ * <p>The order of attributes in the list is unspecified, and will
+ * vary from implementation to implementation.</p>
+ *
+ * @since SAX 2.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.helpers.AttributesImpl
+ * @see org.xml.sax.ext.DeclHandler#attributeDecl
+ */
+public interface Attributes
+{
+
+ ////////////////////////////////////////////////////////////////////
+ // Indexed access.
+ ////////////////////////////////////////////////////////////////////
+
+
+ /**
+ * Return the number of attributes in the list.
+ *
+ * <p>Once you know the number of attributes, you can iterate
+ * through the list.</p>
+ *
+ * @return The number of attributes in the list.
+ * @see #getURI(int)
+ * @see #getLocalName(int)
+ * @see #getQName(int)
+ * @see #getType(int)
+ * @see #getValue(int)
+ */
+ public abstract int getLength ();
+
+
+ /**
+ * Look up an attribute's Namespace URI by index.
+ *
+ * @param index The attribute index (zero-based).
+ * @return The Namespace URI, or the empty string if none
+ * is available, or null if the index is out of
+ * range.
+ * @see #getLength
+ */
+ public abstract String getURI (int index);
+
+
+ /**
+ * Look up an attribute's local name by index.
+ *
+ * @param index The attribute index (zero-based).
+ * @return The local name, or the empty string if Namespace
+ * processing is not being performed, or null
+ * if the index is out of range.
+ * @see #getLength
+ */
+ public abstract String getLocalName (int index);
+
+
+ /**
+ * Look up an attribute's XML 1.0 qualified name by index.
+ *
+ * @param index The attribute index (zero-based).
+ * @return The XML 1.0 qualified name, or the empty string
+ * if none is available, or null if the index
+ * is out of range.
+ * @see #getLength
+ */
+ public abstract String getQName (int index);
+
+
+ /**
+ * Look up an attribute's type by index.
+ *
+ * <p>The attribute type is one of the strings "CDATA", "ID",
+ * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
+ * or "NOTATION" (always in upper case).</p>
+ *
+ * <p>If the parser has not read a declaration for the attribute,
+ * or if the parser does not report attribute types, then it must
+ * return the value "CDATA" as stated in the XML 1.0 Recommentation
+ * (clause 3.3.3, "Attribute-Value Normalization").</p>
+ *
+ * <p>For an enumerated attribute that is not a notation, the
+ * parser will report the type as "NMTOKEN".</p>
+ *
+ * @param index The attribute index (zero-based).
+ * @return The attribute's type as a string, or null if the
+ * index is out of range.
+ * @see #getLength
+ */
+ public abstract String getType (int index);
+
+
+ /**
+ * Look up an attribute's value by index.
+ *
+ * <p>If the attribute value is a list of tokens (IDREFS,
+ * ENTITIES, or NMTOKENS), the tokens will be concatenated
+ * into a single string with each token separated by a
+ * single space.</p>
+ *
+ * @param index The attribute index (zero-based).
+ * @return The attribute's value as a string, or null if the
+ * index is out of range.
+ * @see #getLength
+ */
+ public abstract String getValue (int index);
+
+
+ ////////////////////////////////////////////////////////////////////
+ // Name-based query.
+ ////////////////////////////////////////////////////////////////////
+
+
+ /**
+ * Look up the index of an attribute by Namespace name.
+ *
+ * @param uri The Namespace URI, or the empty string if
+ * the name has no Namespace URI.
+ * @param localName The attribute's local name.
+ * @return The index of the attribute, or -1 if it does not
+ * appear in the list.
+ */
+ public int getIndex (String uri, String localName);
+
+
+ /**
+ * Look up the index of an attribute by XML 1.0 qualified name.
+ *
+ * @param qName The qualified (prefixed) name.
+ * @return The index of the attribute, or -1 if it does not
+ * appear in the list.
+ */
+ public int getIndex (String qName);
+
+
+ /**
+ * Look up an attribute's type by Namespace name.
+ *
+ * <p>See {@link #getType(int) getType(int)} for a description
+ * of the possible types.</p>
+ *
+ * @param uri The Namespace URI, or the empty String if the
+ * name has no Namespace URI.
+ * @param localName The local name of the attribute.
+ * @return The attribute type as a string, or null if the
+ * attribute is not in the list or if Namespace
+ * processing is not being performed.
+ */
+ public abstract String getType (String uri, String localName);
+
+
+ /**
+ * Look up an attribute's type by XML 1.0 qualified name.
+ *
+ * <p>See {@link #getType(int) getType(int)} for a description
+ * of the possible types.</p>
+ *
+ * @param qName The XML 1.0 qualified name.
+ * @return The attribute type as a string, or null if the
+ * attribute is not in the list or if qualified names
+ * are not available.
+ */
+ public abstract String getType (String qName);
+
+
+ /**
+ * Look up an attribute's value by Namespace name.
+ *
+ * <p>See {@link #getValue(int) getValue(int)} for a description
+ * of the possible values.</p>
+ *
+ * @param uri The Namespace URI, or the empty String if the
+ * name has no Namespace URI.
+ * @param localName The local name of the attribute.
+ * @return The attribute value as a string, or null if the
+ * attribute is not in the list.
+ */
+ public abstract String getValue (String uri, String localName);
+
+
+ /**
+ * Look up an attribute's value by XML 1.0 qualified name.
+ *
+ * <p>See {@link #getValue(int) getValue(int)} for a description
+ * of the possible values.</p>
+ *
+ * @param qName The XML 1.0 qualified name.
+ * @return The attribute value as a string, or null if the
+ * attribute is not in the list or if qualified names
+ * are not available.
+ */
+ public abstract String getValue (String qName);
+
+}
+
+// end of Attributes.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/InputSource.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/InputSource.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/InputSource.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/InputSource.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,334 @@
+// SAX input source.
+// http://www.saxproject.org
+// No warranty; no copyright -- use this as you will.
+// $Id: InputSource.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+package org.xml.sax;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+/**
+ * A single input source for an XML entity.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>This class allows a SAX application to encapsulate information
+ * about an input source in a single object, which may include
+ * a public identifier, a system identifier, a byte stream (possibly
+ * with a specified encoding), and/or a character stream.</p>
+ *
+ * <p>There are two places that the application can deliver an
+ * input source to the parser: as the argument to the Parser.parse
+ * method, or as the return value of the EntityResolver.resolveEntity
+ * method.</p>
+ *
+ * <p>The SAX parser will use the InputSource object to determine how
+ * to read XML input. If there is a character stream available, the
+ * parser will read that stream directly, disregarding any text
+ * encoding declaration found in that stream.
+ * If there is no character stream, but there is
+ * a byte stream, the parser will use that byte stream, using the
+ * encoding specified in the InputSource or else (if no encoding is
+ * specified) autodetecting the character encoding using an algorithm
+ * such as the one in the XML specification. If neither a character
+ * stream nor a
+ * byte stream is available, the parser will attempt to open a URI
+ * connection to the resource identified by the system
+ * identifier.</p>
+ *
+ * <p>An InputSource object belongs to the application: the SAX parser
+ * shall never modify it in any way (it may modify a copy if
+ * necessary). However, standard processing of both byte and
+ * character streams is to close them on as part of end-of-parse cleanup,
+ * so applications should not attempt to re-use such streams after they
+ * have been handed to a parser. </p>
+ *
+ * @since SAX 1.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource)
+ * @see org.xml.sax.EntityResolver#resolveEntity
+ * @see java.io.InputStream
+ * @see java.io.Reader
+ */
+public class InputSource {
+
+ /**
+ * Zero-argument default constructor.
+ *
+ * @see #setPublicId
+ * @see #setSystemId
+ * @see #setByteStream
+ * @see #setCharacterStream
+ * @see #setEncoding
+ */
+ public InputSource ()
+ {
+ }
+
+
+ /**
+ * Create a new input source with a system identifier.
+ *
+ * <p>Applications may use setPublicId to include a
+ * public identifier as well, or setEncoding to specify
+ * the character encoding, if known.</p>
+ *
+ * <p>If the system identifier is a URL, it must be fully
+ * resolved (it may not be a relative URL).</p>
+ *
+ * @param systemId The system identifier (URI).
+ * @see #setPublicId
+ * @see #setSystemId
+ * @see #setByteStream
+ * @see #setEncoding
+ * @see #setCharacterStream
+ */
+ public InputSource (String systemId)
+ {
+ setSystemId(systemId);
+ }
+
+
+ /**
+ * Create a new input source with a byte stream.
+ *
+ * <p>Application writers should use setSystemId() to provide a base
+ * for resolving relative URIs, may use setPublicId to include a
+ * public identifier, and may use setEncoding to specify the object's
+ * character encoding.</p>
+ *
+ * @param byteStream The raw byte stream containing the document.
+ * @see #setPublicId
+ * @see #setSystemId
+ * @see #setEncoding
+ * @see #setByteStream
+ * @see #setCharacterStream
+ */
+ public InputSource (InputStream byteStream)
+ {
+ setByteStream(byteStream);
+ }
+
+
+ /**
+ * Create a new input source with a character stream.
+ *
+ * <p>Application writers should use setSystemId() to provide a base
+ * for resolving relative URIs, and may use setPublicId to include a
+ * public identifier.</p>
+ *
+ * <p>The character stream shall not include a byte order mark.</p>
+ *
+ * @see #setPublicId
+ * @see #setSystemId
+ * @see #setByteStream
+ * @see #setCharacterStream
+ */
+ public InputSource (Reader characterStream)
+ {
+ setCharacterStream(characterStream);
+ }
+
+
+ /**
+ * Set the public identifier for this input source.
+ *
+ * <p>The public identifier is always optional: if the application
+ * writer includes one, it will be provided as part of the
+ * location information.</p>
+ *
+ * @param publicId The public identifier as a string.
+ * @see #getPublicId
+ * @see org.xml.sax.Locator#getPublicId
+ * @see org.xml.sax.SAXParseException#getPublicId
+ */
+ public void setPublicId (String publicId)
+ {
+ this.publicId = publicId;
+ }
+
+
+ /**
+ * Get the public identifier for this input source.
+ *
+ * @return The public identifier, or null if none was supplied.
+ * @see #setPublicId
+ */
+ public String getPublicId ()
+ {
+ return publicId;
+ }
+
+
+ /**
+ * Set the system identifier for this input source.
+ *
+ * <p>The system identifier is optional if there is a byte stream
+ * or a character stream, but it is still useful to provide one,
+ * since the application can use it to resolve relative URIs
+ * and can include it in error messages and warnings (the parser
+ * will attempt to open a connection to the URI only if
+ * there is no byte stream or character stream specified).</p>
+ *
+ * <p>If the application knows the character encoding of the
+ * object pointed to by the system identifier, it can register
+ * the encoding using the setEncoding method.</p>
+ *
+ * <p>If the system identifier is a URL, it must be fully
+ * resolved (it may not be a relative URL).</p>
+ *
+ * @param systemId The system identifier as a string.
+ * @see #setEncoding
+ * @see #getSystemId
+ * @see org.xml.sax.Locator#getSystemId
+ * @see org.xml.sax.SAXParseException#getSystemId
+ */
+ public void setSystemId (String systemId)
+ {
+ this.systemId = systemId;
+ }
+
+
+ /**
+ * Get the system identifier for this input source.
+ *
+ * <p>The getEncoding method will return the character encoding
+ * of the object pointed to, or null if unknown.</p>
+ *
+ * <p>If the system ID is a URL, it will be fully resolved.</p>
+ *
+ * @return The system identifier, or null if none was supplied.
+ * @see #setSystemId
+ * @see #getEncoding
+ */
+ public String getSystemId ()
+ {
+ return systemId;
+ }
+
+
+ /**
+ * Set the byte stream for this input source.
+ *
+ * <p>The SAX parser will ignore this if there is also a character
+ * stream specified, but it will use a byte stream in preference
+ * to opening a URI connection itself.</p>
+ *
+ * <p>If the application knows the character encoding of the
+ * byte stream, it should set it with the setEncoding method.</p>
+ *
+ * @param byteStream A byte stream containing an XML document or
+ * other entity.
+ * @see #setEncoding
+ * @see #getByteStream
+ * @see #getEncoding
+ * @see java.io.InputStream
+ */
+ public void setByteStream (InputStream byteStream)
+ {
+ this.byteStream = byteStream;
+ }
+
+
+ /**
+ * Get the byte stream for this input source.
+ *
+ * <p>The getEncoding method will return the character
+ * encoding for this byte stream, or null if unknown.</p>
+ *
+ * @return The byte stream, or null if none was supplied.
+ * @see #getEncoding
+ * @see #setByteStream
+ */
+ public InputStream getByteStream ()
+ {
+ return byteStream;
+ }
+
+
+ /**
+ * Set the character encoding, if known.
+ *
+ * <p>The encoding must be a string acceptable for an
+ * XML encoding declaration (see section 4.3.3 of the XML 1.0
+ * recommendation).</p>
+ *
+ * <p>This method has no effect when the application provides a
+ * character stream.</p>
+ *
+ * @param encoding A string describing the character encoding.
+ * @see #setSystemId
+ * @see #setByteStream
+ * @see #getEncoding
+ */
+ public void setEncoding (String encoding)
+ {
+ this.encoding = encoding;
+ }
+
+
+ /**
+ * Get the character encoding for a byte stream or URI.
+ * This value will be ignored when the application provides a
+ * character stream.
+ *
+ * @return The encoding, or null if none was supplied.
+ * @see #setByteStream
+ * @see #getSystemId
+ * @see #getByteStream
+ */
+ public String getEncoding ()
+ {
+ return encoding;
+ }
+
+
+ /**
+ * Set the character stream for this input source.
+ *
+ * <p>If there is a character stream specified, the SAX parser
+ * will ignore any byte stream and will not attempt to open
+ * a URI connection to the system identifier.</p>
+ *
+ * @param characterStream The character stream containing the
+ * XML document or other entity.
+ * @see #getCharacterStream
+ * @see java.io.Reader
+ */
+ public void setCharacterStream (Reader characterStream)
+ {
+ this.characterStream = characterStream;
+ }
+
+
+ /**
+ * Get the character stream for this input source.
+ *
+ * @return The character stream, or null if none was supplied.
+ * @see #setCharacterStream
+ */
+ public Reader getCharacterStream ()
+ {
+ return characterStream;
+ }
+
+ ////////////////////////////////////////////////////////////////////
+ // Internal state.
+ ////////////////////////////////////////////////////////////////////
+
+ private String publicId;
+ private String systemId;
+ private InputStream byteStream;
+ private String encoding;
+ private Reader characterStream;
+
+}
+
+// end of InputSource.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Locator.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Locator.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Locator.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/Locator.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,136 @@
+// SAX locator interface for document events.
+// http://www.saxproject.org
+// No warranty; no copyright -- use this as you will.
+// $Id: Locator.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+package org.xml.sax;
+
+
+/**
+ * Interface for associating a SAX event with a document location.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>If a SAX parser provides location information to the SAX
+ * application, it does so by implementing this interface and then
+ * passing an instance to the application using the content
+ * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator
+ * setDocumentLocator} method. The application can use the
+ * object to obtain the location of any other SAX event
+ * in the XML source document.</p>
+ *
+ * <p>Note that the results returned by the object will be valid only
+ * during the scope of each callback method: the application
+ * will receive unpredictable results if it attempts to use the
+ * locator at any other time, or after parsing completes.</p>
+ *
+ * <p>SAX parsers are not required to supply a locator, but they are
+ * very strongly encouraged to do so. If the parser supplies a
+ * locator, it must do so before reporting any other document events.
+ * If no locator has been set by the time the application receives
+ * the {@link org.xml.sax.ContentHandler#startDocument startDocument}
+ * event, the application should assume that a locator is not
+ * available.</p>
+ *
+ * @since SAX 1.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.ContentHandler#setDocumentLocator
+ */
+public interface Locator {
+
+
+ /**
+ * Return the public identifier for the current document event.
+ *
+ * <p>The return value is the public identifier of the document
+ * entity or of the external parsed entity in which the markup
+ * triggering the event appears.</p>
+ *
+ * @return A string containing the public identifier, or
+ * null if none is available.
+ * @see #getSystemId
+ */
+ public abstract String getPublicId ();
+
+
+ /**
+ * Return the system identifier for the current document event.
+ *
+ * <p>The return value is the system identifier of the document
+ * entity or of the external parsed entity in which the markup
+ * triggering the event appears.</p>
+ *
+ * <p>If the system identifier is a URL, the parser must resolve it
+ * fully before passing it to the application. For example, a file
+ * name must always be provided as a <em>file:...</em> URL, and other
+ * kinds of relative URI are also resolved against their bases.</p>
+ *
+ * @return A string containing the system identifier, or null
+ * if none is available.
+ * @see #getPublicId
+ */
+ public abstract String getSystemId ();
+
+
+ /**
+ * Return the line number where the current document event ends.
+ * Lines are delimited by line ends, which are defined in
+ * the XML specification.
+ *
+ * <p><strong>Warning:</strong> The return value from the method
+ * is intended only as an approximation for the sake of diagnostics;
+ * it is not intended to provide sufficient information
+ * to edit the character content of the original XML document.
+ * In some cases, these "line" numbers match what would be displayed
+ * as columns, and in others they may not match the source text
+ * due to internal entity expansion. </p>
+ *
+ * <p>The return value is an approximation of the line number
+ * in the document entity or external parsed entity where the
+ * markup triggering the event appears.</p>
+ *
+ * <p>If possible, the SAX driver should provide the line position
+ * of the first character after the text associated with the document
+ * event. The first line is line 1.</p>
+ *
+ * @return The line number, or -1 if none is available.
+ * @see #getColumnNumber
+ */
+ public abstract int getLineNumber ();
+
+
+ /**
+ * Return the column number where the current document event ends.
+ * This is one-based number of Java <code>char</code> values since
+ * the last line end.
+ *
+ * <p><strong>Warning:</strong> The return value from the method
+ * is intended only as an approximation for the sake of diagnostics;
+ * it is not intended to provide sufficient information
+ * to edit the character content of the original XML document.
+ * For example, when lines contain combining character sequences, wide
+ * characters, surrogate pairs, or bi-directional text, the value may
+ * not correspond to the column in a text editor's display. </p>
+ *
+ * <p>The return value is an approximation of the column number
+ * in the document entity or external parsed entity where the
+ * markup triggering the event appears.</p>
+ *
+ * <p>If possible, the SAX driver should provide the line position
+ * of the first character after the text associated with the document
+ * event. The first column in each line is column 1.</p>
+ *
+ * @return The column number, or -1 if none is available.
+ * @see #getLineNumber
+ */
+ public abstract int getColumnNumber ();
+
+}
+
+// end of Locator.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXException.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXException.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXException.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXException.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,45 @@
+// SAX exception class.
+// http://www.saxproject.org
+// No warranty; no copyright -- use this as you will.
+// $Id: SAXException.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+package org.xml.sax;
+
+/**
+ * Encapsulate a general SAX error or warning.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>This class can contain basic error or warning information from
+ * either the XML parser or the application: a parser writer or
+ * application writer can subclass it to provide additional
+ * functionality. SAX handlers may throw this exception or
+ * any exception subclassed from it.</p>
+ *
+ * <p>If the application needs to pass through other types of
+ * exceptions, it must wrap those exceptions in a SAXException
+ * or an exception derived from a SAXException.</p>
+ *
+ * <p>If the parser or application needs to include information about a
+ * specific location in an XML document, it should use the
+ * {@link org.xml.sax.SAXParseException SAXParseException} subclass.</p>
+ *
+ * @since SAX 1.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.SAXParseException
+ */
+public class SAXException extends Exception {
+
+ public SAXException (String message) {
+ super(message);
+ }
+
+}
+
+// end of SAXException.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotRecognizedException.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotRecognizedException.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotRecognizedException.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotRecognizedException.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,46 @@
+// SAXNotRecognizedException.java - unrecognized feature or value.
+// http://www.saxproject.org
+// Written by David Megginson
+// NO WARRANTY! This class is in the Public Domain.
+
+// $Id: SAXNotRecognizedException.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+
+package org.xml.sax;
+
+
+/**
+ * Exception class for an unrecognized identifier.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>An XMLReader will throw this exception when it finds an
+ * unrecognized feature or property identifier; SAX applications and
+ * extensions may use this class for other, similar purposes.</p>
+ *
+ * @since SAX 2.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.SAXNotSupportedException
+ */
+public class SAXNotRecognizedException extends SAXException
+{
+
+ /**
+ * Construct a new exception with the given message.
+ *
+ * @param message The text message of the exception.
+ */
+ public SAXNotRecognizedException (String message)
+ {
+ super(message);
+ }
+
+}
+
+// end of SAXNotRecognizedException.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotSupportedException.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotSupportedException.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotSupportedException.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXNotSupportedException.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,46 @@
+// SAXNotSupportedException.java - unsupported feature or value.
+// http://www.saxproject.org
+// Written by David Megginson
+// NO WARRANTY! This class is in the Public Domain.
+
+// $Id: SAXNotSupportedException.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+
+package org.xml.sax;
+
+/**
+ * Exception class for an unsupported operation.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>An XMLReader will throw this exception when it recognizes a
+ * feature or property identifier, but cannot perform the requested
+ * operation (setting a state or value). Other SAX2 applications and
+ * extensions may use this class for similar purposes.</p>
+ *
+ * @since SAX 2.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.SAXNotRecognizedException
+ */
+public class SAXNotSupportedException extends SAXException
+{
+
+ /**
+ * Construct a new exception with the given message.
+ *
+ * @param message The text message of the exception.
+ */
+ public SAXNotSupportedException (String message)
+ {
+ super(message);
+ }
+
+}
+
+// end of SAXNotSupportedException.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXParseException.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXParseException.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXParseException.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/SAXParseException.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,162 @@
+// SAX exception class.
+// http://www.saxproject.org
+// No warranty; no copyright -- use this as you will.
+// $Id: SAXParseException.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+package org.xml.sax;
+
+/**
+ * Encapsulate an XML parse error or warning.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ * for further information.
+ * </blockquote>
+ *
+ * <p>This exception may include information for locating the error
+ * in the original XML document, as if it came from a {@link Locator}
+ * object. Note that although the application
+ * will receive a SAXParseException as the argument to the handlers
+ * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface,
+ * the application is not actually required to throw the exception;
+ * instead, it can simply read the information in it and take a
+ * different action.</p>
+ *
+ * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException
+ * SAXException}, it inherits the ability to wrap another exception.</p>
+ *
+ * @since SAX 1.0
+ * @author David Megginson
+ * @version 2.0.1 (sax2r2)
+ * @see org.xml.sax.SAXException
+ * @see org.xml.sax.Locator
+ * @see org.xml.sax.ErrorHandler
+ */
+public class SAXParseException extends SAXException {
+
+ //////////////////////////////////////////////////////////////////////
+ // Constructors.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * Create a new SAXParseException from a message and a Locator.
+ *
+ * <p>This constructor is especially useful when an application is
+ * creating its own exception from within a {@link org.xml.sax.ContentHandler
+ * ContentHandler} callback.</p>
+ *
+ * @param message The error or warning message.
+ * @param locator The locator object for the error or warning (may be
+ * null).
+ * @see org.xml.sax.Locator
+ */
+ public SAXParseException(String message, Locator locator) {
+ super(message);
+ if (locator != null) {
+ init(locator.getPublicId(), locator.getSystemId(), locator.getLineNumber(), locator.getColumnNumber());
+ } else {
+ init(null, null, -1, -1);
+ }
+ }
+
+ /**
+ * Internal initialization method.
+ *
+ * @param publicId The public identifier of the entity which generated the exception,
+ * or null.
+ * @param systemId The system identifier of the entity which generated the exception,
+ * or null.
+ * @param lineNumber The line number of the error, or -1.
+ * @param columnNumber The column number of the error, or -1.
+ */
+ private void init(String publicId, String systemId, int lineNumber, int columnNumber) {
+ this.publicId = publicId;
+ this.systemId = systemId;
+ this.lineNumber = lineNumber;
+ this.columnNumber = columnNumber;
+ }
+
+ /**
+ * Get the public identifier of the entity where the exception occurred.
+ *
+ * @return A string containing the public identifier, or null
+ * if none is available.
+ * @see org.xml.sax.Locator#getPublicId
+ */
+ public String getPublicId() {
+ return this.publicId;
+ }
+
+ /**
+ * Get the system identifier of the entity where the exception occurred.
+ *
+ * <p>If the system identifier is a URL, it will have been resolved
+ * fully.</p>
+ *
+ * @return A string containing the system identifier, or null
+ * if none is available.
+ * @see org.xml.sax.Locator#getSystemId
+ */
+ public String getSystemId() {
+ return this.systemId;
+ }
+
+ /**
+ * The line number of the end of the text where the exception occurred.
+ *
+ * <p>The first line is line 1.</p>
+ *
+ * @return An integer representing the line number, or -1
+ * if none is available.
+ * @see org.xml.sax.Locator#getLineNumber
+ */
+ public int getLineNumber() {
+ return this.lineNumber;
+ }
+
+ /**
+ * The column number of the end of the text where the exception occurred.
+ *
+ * <p>The first column in a line is position 1.</p>
+ *
+ * @return An integer representing the column number, or -1
+ * if none is available.
+ * @see org.xml.sax.Locator#getColumnNumber
+ */
+ public int getColumnNumber() {
+ return this.columnNumber;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // Internal state.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * @serial The public identifier, or null.
+ * @see #getPublicId
+ */
+ private String publicId;
+
+ /**
+ * @serial The system identifier, or null.
+ * @see #getSystemId
+ */
+ private String systemId;
+
+ /**
+ * @serial The line number, or -1.
+ * @see #getLineNumber
+ */
+ private int lineNumber;
+
+ /**
+ * @serial The column number, or -1.
+ * @see #getColumnNumber
+ */
+ private int columnNumber;
+
+}
+
+// end of SAXParseException.java
Added: webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/helpers/DefaultHandler.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/helpers/DefaultHandler.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/helpers/DefaultHandler.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxp/org/xml/sax/helpers/DefaultHandler.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,416 @@
+// DefaultHandler.java - default implementation of the core handlers.
+// Written by David Megginson, sax@megginson.com
+// NO WARRANTY! This class is in the public domain.
+
+// $Id: DefaultHandler.java,v 1.1 2004/11/15 07:46:05 damitha Exp $
+
+package org.xml.sax.helpers;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+
+/**
+ * Default base class for SAX2 event handlers.
+ *
+ * <blockquote>
+ * <em>This module, both source code and documentation, is in the
+ * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ * </blockquote>
+ *
+ * <p>This class is available as a convenience base class for SAX2
+ * applications: it provides default implementations for all of the
+ * callbacks in the four core SAX2 handler classes:</p>
+ *
+ * <ul>
+ * <li>{@link org.xml.sax.EntityResolver EntityResolver}</li>
+ * <li>{@link org.xml.sax.DTDHandler DTDHandler}</li>
+ * <li>{@link org.xml.sax.ContentHandler ContentHandler}</li>
+ * <li>{@link org.xml.sax.ErrorHandler ErrorHandler}</li>
+ * </ul>
+ *
+ * <p>Application writers can extend this class when they need to
+ * implement only part of an interface; parser writers can
+ * instantiate this class to provide default handlers when the
+ * application has not supplied its own.</p>
+ *
+ * <p>This class replaces the deprecated SAX1
+ * {@link org.xml.sax.HandlerBase HandlerBase} class.</p>
+ *
+ * @since SAX 2.0
+ * @author David Megginson,
+ * <a href="mailto:sax@megginson.com">sax@megginson.com</a>
+ * @version 2.0
+ * @see org.xml.sax.EntityResolver
+ * @see org.xml.sax.DTDHandler
+ * @see org.xml.sax.ContentHandler
+ * @see org.xml.sax.ErrorHandler
+ */
+public class DefaultHandler {
+
+ public DefaultHandler() {
+
+ }
+ /**
+ * Resolve an external entity.
+ *
+ * <p>Always return null, so that the parser will use the system
+ * identifier provided in the XML document. This method implements
+ * the SAX default behaviour: application writers can override it
+ * in a subclass to do special translations such as catalog lookups
+ * or URI redirection.</p>
+ *
+ * @param publicId The public identifer, or null if none is
+ * available.
+ * @param systemId The system identifier provided in the XML
+ * document.
+ * @return The new input source, or null to require the
+ * default behaviour.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.EntityResolver#resolveEntity
+ */
+ public InputSource resolveEntity (String publicId, String systemId)
+ throws SAXException
+ {
+ return null;
+ }
+
+ /**
+ * Receive notification of a notation declaration.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass if they wish to keep track of the notations
+ * declared in a document.</p>
+ *
+ * @param name The notation name.
+ * @param publicId The notation public identifier, or null if not
+ * available.
+ * @param systemId The notation system identifier.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.DTDHandler#notationDecl
+ */
+ public void notationDecl (String name, String publicId, String systemId)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of an unparsed entity declaration.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to keep track of the unparsed entities
+ * declared in a document.</p>
+ *
+ * @param name The entity name.
+ * @param publicId The entity public identifier, or null if not
+ * available.
+ * @param systemId The entity system identifier.
+ * @param notationName The name of the associated notation.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.DTDHandler#unparsedEntityDecl
+ */
+ public void unparsedEntityDecl (String name, String publicId,
+ String systemId, String notationName)
+ throws SAXException
+ {
+ // no op
+ }
+
+ /**
+ * Receive a Locator object for document events.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass if they wish to store the locator for use
+ * with other document events.</p>
+ *
+ * @param locator A locator for all SAX document events.
+ * @see org.xml.sax.ContentHandler#setDocumentLocator
+ * @see org.xml.sax.Locator
+ */
+ public void setDocumentLocator (Locator locator)
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the beginning of the document.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the beginning
+ * of a document (such as allocating the root node of a tree or
+ * creating an output file).</p>
+ *
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#startDocument
+ */
+ public void startDocument ()
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the end of the document.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the end
+ * of a document (such as finalising a tree or closing an output
+ * file).</p>
+ *
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#endDocument
+ */
+ public void endDocument ()
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the start of a Namespace mapping.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the start of
+ * each Namespace prefix scope (such as storing the prefix mapping).</p>
+ *
+ * @param prefix The Namespace prefix being declared.
+ * @param uri The Namespace URI mapped to the prefix.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#startPrefixMapping
+ */
+ public void startPrefixMapping (String prefix, String uri)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the end of a Namespace mapping.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the end of
+ * each prefix mapping.</p>
+ *
+ * @param prefix The Namespace prefix being declared.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#endPrefixMapping
+ */
+ public void endPrefixMapping (String prefix)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the start of an element.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the start of
+ * each element (such as allocating a new tree node or writing
+ * output to a file).</p>
+ *
+ * @param name The element type name.
+ * @param attributes The specified or defaulted attributes.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#startElement
+ */
+ public void startElement (String uri, String localName,
+ String qName, Attributes attributes)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of the end of an element.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions at the end of
+ * each element (such as finalising a tree node or writing
+ * output to a file).</p>
+ *
+ * @param name The element type name.
+ * @param attributes The specified or defaulted attributes.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#endElement
+ */
+ public void endElement (String uri, String localName, String qName)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of character data inside an element.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method to take specific actions for each chunk of character data
+ * (such as adding the data to a node or buffer, or printing it to
+ * a file).</p>
+ *
+ * @param ch The characters.
+ * @param start The start position in the character array.
+ * @param length The number of characters to use from the
+ * character array.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#characters
+ */
+ public void characters (char ch[], int start, int length)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of ignorable whitespace in element content.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method to take specific actions for each chunk of ignorable
+ * whitespace (such as adding data to a node or buffer, or printing
+ * it to a file).</p>
+ *
+ * @param ch The whitespace characters.
+ * @param start The start position in the character array.
+ * @param length The number of characters to use from the
+ * character array.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#ignorableWhitespace
+ */
+ public void ignorableWhitespace (char ch[], int start, int length)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of a processing instruction.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions for each
+ * processing instruction, such as setting status variables or
+ * invoking other methods.</p>
+ *
+ * @param target The processing instruction target.
+ * @param data The processing instruction data, or null if
+ * none is supplied.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#processingInstruction
+ */
+ public void processingInstruction (String target, String data)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of a skipped entity.
+ *
+ * <p>By default, do nothing. Application writers may override this
+ * method in a subclass to take specific actions for each
+ * processing instruction, such as setting status variables or
+ * invoking other methods.</p>
+ *
+ * @param name The name of the skipped entity.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ContentHandler#processingInstruction
+ */
+ public void skippedEntity (String name)
+ throws SAXException
+ {
+ // no op
+ }
+
+ /**
+ * Receive notification of a parser warning.
+ *
+ * <p>The default implementation does nothing. Application writers
+ * may override this method in a subclass to take specific actions
+ * for each warning, such as inserting the message in a log file or
+ * printing it to the console.</p>
+ *
+ * @param e The warning information encoded as an exception.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ErrorHandler#warning
+ * @see org.xml.sax.SAXParseException
+ */
+ public void warning (SAXParseException e)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Receive notification of a recoverable parser error.
+ *
+ * <p>The default implementation does nothing. Application writers
+ * may override this method in a subclass to take specific actions
+ * for each error, such as inserting the message in a log file or
+ * printing it to the console.</p>
+ *
+ * @param e The warning information encoded as an exception.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ErrorHandler#warning
+ * @see org.xml.sax.SAXParseException
+ */
+ public void error (SAXParseException e)
+ throws SAXException
+ {
+ // no op
+ }
+
+
+ /**
+ * Report a fatal XML parsing error.
+ *
+ * <p>The default implementation throws a SAXParseException.
+ * Application writers may override this method in a subclass if
+ * they need to take specific actions for each fatal error (such as
+ * collecting all of the errors into a single report): in any case,
+ * the application must stop all regular processing when this
+ * method is invoked, since the document is no longer reliable, and
+ * the parser may no longer report parsing events.</p>
+ *
+ * @param e The error information encoded as an exception.
+ * @exception org.xml.sax.SAXException Any SAX exception, possibly
+ * wrapping another exception.
+ * @see org.xml.sax.ErrorHandler#fatalError
+ * @see org.xml.sax.SAXParseException
+ */
+ public void fatalError (SAXParseException e)
+ throws SAXException
+ {
+ throw e;
+ }
+
+}
\ No newline at end of file
Added: webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/namespace/QName.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/namespace/QName.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/namespace/QName.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/namespace/QName.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package javax.xml.namespace;
+
+
+/**
+ * <code>QName</code> class represents the value of a qualified name
+ * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML
+ * Schema Part2: Datatypes specification</a>.
+ * <p>
+ * The value of a QName contains a <b>namespaceURI</b>, a <b>localPart</b> and a <b>prefix</b>.
+ * The localPart provides the local part of the qualified name. The
+ * namespaceURI is a URI reference identifying the namespace.
+ *
+ * @author kurinchikumaran(kurinchikumaran@hsenid.lk)
+ */
+public class QName {
+
+ /** Field namespaceURI */
+ private String namespaceURI;
+
+ /** Field localPart */
+ private String localPart;
+
+ /** Field prefix */
+ private String prefix;
+
+ /**
+ * Constructor for the QName.
+ *
+ * @param localPart Local part of the QName
+ */
+ public QName(String localPart) {
+ this("", localPart, "");
+ }
+
+ /**
+ * Constructor for the QName.
+ *
+ * @param namespaceURI Namespace URI for the QName
+ * @param localPart Local part of the QName.
+ */
+ public QName(String namespaceURI, String localPart) {
+ this(namespaceURI, localPart, "");
+ }
+
+ /**
+ * Constructor for the QName.
+ *
+ * @param namespaceURI Namespace URI for the QName
+ * @param localPart Local part of the QName.
+ * @param prefix Prefix of the QName.
+ */
+ public QName(String namespaceURI, String localPart, String prefix) {
+ this.namespaceURI = (namespaceURI == null)
+ ? ""
+ : namespaceURI;
+ if (localPart == null) {
+ throw new IllegalArgumentException("invalid QName local part");
+ } else {
+ this.localPart = localPart;
+ }
+
+ if (prefix == null) {
+ throw new IllegalArgumentException("invalid QName prefix");
+ } else {
+ this.prefix = prefix;
+ }
+ }
+
+ /**
+ * Gets the Namespace URI for this QName
+ *
+ * @return Namespace URI
+ */
+ public String getNamespaceURI() {
+ return namespaceURI;
+ }
+
+ /**
+ * Gets the Local part for this QName
+ *
+ * @return Local part
+ */
+ public String getLocalPart() {
+ return localPart;
+ }
+
+ /**
+ * Gets the Prefix for this QName
+ *
+ * @return Prefix
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * Returns a string representation of this QName
+ *
+ * @return a string representation of the QName
+ */
+ public String toString() {
+
+ return ((namespaceURI.equals(""))
+ ? localPart
+ : '{' + namespaceURI + '}' + localPart);
+ }
+
+ /**
+ * Tests this QName for equality with another object.
+ * <p>
+ * If the given object is not a QName or is null then this method
+ * returns <tt>false</tt>.
+ * <p>
+ * For two QNames to be considered equal requires that both
+ * localPart and namespaceURI must be equal. This method uses
+ * <code>String.equals</code> to check equality of localPart
+ * and namespaceURI. Any class that extends QName is required
+ * to satisfy this equality contract.
+ * <p>
+ * This method satisfies the general contract of the <code>Object.equals</code> method.
+ *
+ * @param obj the reference object with which to compare
+ *
+ * @return <code>true</code> if the given object is identical to this
+ * QName: <code>false</code> otherwise.
+ */
+ public final boolean equals(Object obj) {
+
+ if (obj == this) {
+ return true;
+ }
+
+ if (!(obj instanceof QName)) {
+ return false;
+ }
+
+ if ((namespaceURI.equals(((QName) obj).namespaceURI))
+ && (localPart.equals(((QName) obj).localPart))) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a QName holding the value of the specified String.
+ * <p>
+ * The string must be in the form returned by the QName.toString()
+ * method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}"
+ * part being optional.
+ * <p>
+ * This method doesn't do a full validation of the resulting QName.
+ * In particular, it doesn't check that the resulting namespace URI
+ * is a legal URI (per RFC 2396 and RFC 2732), nor that the resulting
+ * local part is a legal NCName per the XML Namespaces specification.
+ *
+ * @param s the string to be parsed
+ * @throws java.lang.IllegalArgumentException If the specified String cannot be parsed as a QName
+ * @return QName corresponding to the given String
+ */
+ public static QName valueOf(String s) {
+
+ if ((s == null) || s.equals("")) {
+ throw new IllegalArgumentException("invalid QName literal");
+ }
+
+ if (s.charAt(0) == '{') {
+ int i = s.indexOf('}');
+
+ if (i == -1) {
+ throw new IllegalArgumentException("invalid QName literal");
+ }
+
+ if (i == s.length() - 1) {
+ throw new IllegalArgumentException("invalid QName literal");
+ } else {
+ return new QName(s.substring(1, i), s.substring(i + 1));
+ }
+ } else {
+ return new QName(s);
+ }
+ }
+
+ /**
+ * Returns a hash code value for this QName object. The hash code
+ * is based on both the localPart and namespaceURI parts of the
+ * QName. This method satisfies the general contract of the
+ * <code>Object.hashCode</code> method.
+ *
+ * @return a hash code value for this Qname object
+ */
+ public final int hashCode() {
+ return namespaceURI.hashCode() ^ localPart.hashCode();
+ }
+
+}
Propchange: webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/namespace/QName.java
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/rpc/NamespaceConstants.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/rpc/NamespaceConstants.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/rpc/NamespaceConstants.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/rpc/NamespaceConstants.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package javax.xml.rpc;
+
+/**
+ * <code>NamespaceConstants</code> Constants used in JAX-RPC
+ * for namespace prefixes and URIs
+ *
+ * @author kurinchikumaran(kurinchikumaran@hsenid.lk)
+ */
+public class NamespaceConstants {
+
+ /**
+ * Constructor NamespaceConstants
+ */
+ public NamespaceConstants() {}
+
+ /** Namespace prefix for SOAP Envelope */
+ public static final String NSPREFIX_SOAP_ENVELOPE = "soapenv";
+
+ /** Namespace prefix for SOAP Encoding. */
+ public static final String NSPREFIX_SOAP_ENCODING = "soapenc";
+
+ /** Namespace prefix for XML schema XSD */
+ public static final String NSPREFIX_SCHEMA_XSD = "xsd";
+
+ /** Namespace prefix for XML Schema XSI */
+ public static final String NSPREFIX_SCHEMA_XSI = "xsi";
+
+ /** Nameapace URI for SOAP 1.1 Envelope */
+ public static final String NSURI_SOAP_ENVELOPE =
+ "http://schemas.xmlsoap.org/soap/envelope/";
+
+ /** Nameapace URI for SOAP 1.1 Encoding */
+ public static final String NSURI_SOAP_ENCODING =
+ "http://schemas.xmlsoap.org/soap/encoding/";
+
+ /** Nameapace URI for SOAP 1.1 next actor role */
+ public static final String NSURI_SOAP_NEXT_ACTOR =
+ "http://schemas.xmlsoap.org/soap/actor/next";
+
+ /** Namespace URI for XML Schema XSD */
+ public static final String NSURI_SCHEMA_XSD =
+ "http://www.w3.org/2001/XMLSchema";
+
+ /** Namespace URI for XML Schema XSI */
+ public static final String NSURI_SCHEMA_XSI =
+ "http://www.w3.org/2001/XMLSchema-instance";
+}
\ No newline at end of file
Propchange: webservices/mirae/trunk/src/mirae/jaxrpc/javax/xml/rpc/NamespaceConstants.java
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/Constants.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/Constants.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/Constants.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.mirae.util;
+
+/**
+ * The <code>j2me.util.Constants</code> contains all the
+ * constants used by JAX-RPC API.
+ *
+ * @author kurinchikumaran(kurinchikumaran@hsenid.lk)
+ */
+public class Constants {
+
+ /** User agent request property name for the HTTP header */
+ public static final String HEADER_USER_AGENT = "User-Agent";
+
+ /** Content type request property name for the HTTP header */
+ public static final String HEADER_CONTENT_TYPE = "Content-Type";
+
+ /** Content language request property name for the HTTP header */
+ public static final String HEADER_CONTENT_LANGUAGE = "Content-Language";
+
+ /** SOAPAction request property name for the HTTP header */
+ public static final String HEADER_SOAP_ACTION = "SOAPAction";
+
+ /** User agent originating the request for the HTTP header */
+ public static final String HEADER_CLIENT = "Mirae";
+
+ /** Type of content returned by HTTP for the HTTP header */
+ public static final String HEADER_ACCEPT_TEXT_XML = "text/xml";
+
+ /** Natural language of the enclosed entity for the HTTP header */
+ public static final String HEADER_ACCEPT_EN = "en-US";
+
+ /**RPC style SOAP request */
+ public static final String STYLE_RPC = "rpc";
+
+ /**DOCUMENT style SOAP request */
+ public static final String STYLE_DOCUMENT = "document";
+
+ /** Return type is Simple type */
+ public static final int TYPE_SIMPLE = 1;
+
+ /** Return type is Complex type */
+ public static final int TYPE_COMPLEX = 2;
+
+ /** Return type is Array */
+ public static final int TYPE_ARRAY = 3;
+
+ /** Return type is Document Literal type */
+ public static final int TYPE_DOCLIT = 4;
+
+}
\ No newline at end of file
Added: webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/MIRAEException.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/MIRAEException.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/MIRAEException.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/util/MIRAEException.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mirae.util;
+
+/**
+ * The <code>j2me.util.MIRAEException</code> is thrown from the core
+ * JAX-RPC APIs to indicate an exception related to the JAX-RPC API.
+ *
+ * @author kurinchikumaran(kurinchikumaran@hsenid.lk)
+ */
+public class MIRAEException extends Exception {
+
+ /** Field cause */
+ Throwable cause;
+
+ /**
+ * Default constructor
+ *
+ */
+ public MIRAEException() {
+ super();
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ *
+ * @param message
+ * The detail message which is later retrieved using the
+ * getMessage method
+ * @param cause
+ * The cause which is saved for the later retrieval throw by the
+ * getLinkedCause method
+ */
+ public MIRAEException(String message, Throwable cause) {
+ super(message);
+ this.cause = cause;
+ }
+
+ /**
+ * Constructs a new WSMobileException with the specified cause and a detail
+ * message of <tt>cause.toString()</tt> (if cause is non-null) which
+ * typically contains the class and detail message of <tt>cause</tt>.
+ *
+ * @param cause
+ * The cause which is saved for the later retrieval throw by the
+ * getLinkedCause method. (A<tt>null</tt> value is permitted,
+ * and indicates that the cause is nonexistent or unknown.)
+ */
+ public MIRAEException(Throwable cause) {
+ this.cause = cause;
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message. The cause
+ * is not initialized.
+ *
+ * @param message
+ * The detail message which is later retrieved using the
+ * getMessage method
+ */
+ public MIRAEException(String message) {
+ super(message);
+ }
+
+ /**
+ * Gets the Linked cause
+ *
+ * @return The cause of this Exception or <code>null</code> if the cause
+ * is noexistent or unknown
+ */
+ public Throwable getLinkedCause() {
+ return cause;
+ }
+
+}
\ No newline at end of file
Added: webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/xml/rpc/Call.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/xml/rpc/Call.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/xml/rpc/Call.java (added)
+++ webservices/mirae/trunk/src/mirae/jaxrpc/org/apache/mirae/xml/rpc/Call.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mirae.xml.rpc;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Vector;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.HttpConnection;
+import javax.xml.namespace.QName;
+
+import org.apache.mirae.util.Constants;
+import org.apache.mirae.util.MIRAEException;
+
+
+/**
+ * <code>Call</code> class gets input data from generated client stubs and
+ * handles serialisation of SOAP request. It uses the SAX parser to deserialize
+ * the SOAP response and send the result object back to client application.
+ *
+ * @author kurinchikumaran(kurinchikumaran@hsenid.lk)
+ */
+public class Call {
+
+ /** Specify the return category (Simple | Complex | Array | DOCLIT) */
+ private int returnCategory;
+
+ /** Target End point URI */
+ private String uri = null;
+
+ /** SOAP style (RPC | DOCUMENT) */
+ private String style = null;
+
+ /** Local part of Output QName */
+ private String validationCode = null;
+
+ /** SOAP Action */
+ private QName soapAction = null;
+
+ /** Operation Name */
+ private QName operationName = null;
+
+ /** Input Parameter Info Array */
+ private InputParameterInfo[] inInfo = null;
+
+ /** Type of object returned by the API */
+ private InOutParameter returnType = null;
+
+ /** Input stream from the server */
+ private InputStream inputStream = null;
+
+ /** Output stream to the server */
+ private OutputStream outputStream = null;
+
+ /** HttpConnection to the server */
+ HttpConnection httpConnection = null;
+
+ /** Vector for holding input Input Parameter Info elements */
+ Vector inParams = null;
+
+ /**
+ * Default Constructor
+ *
+ * @throws MIRAEException
+ */
+ public Call() throws MIRAEException {
+ this.inParams = new Vector();
+ }
+
+ /**
+ * Method for adding input parameters
+ * While adding every parameter InputParameterInfo object is created
+ * and added into a vector
+ *
+ * @param param Input parameter
+ * @param paramName Name of the input parameter
+ * @param xmlType QName for the input parameter
+ * @throws MIRAEException
+ */
+ public void addParameter(InOutParameter param, String paramName, QName xmlType) throws MIRAEException {
+ this.inParams.addElement(new InputParameterInfo(param,paramName,xmlType));
+ }
+
+ /**
+ * Defining style DOC||RPC
+ * @param style
+ * @throws MIRAEException
+ */
+ public void setStyle(String style) throws MIRAEException {
+ this.style=style;
+ }
+
+ /**
+ * Get style DOC||RPC
+ * @return style
+ * @throws MIRAEException
+ */
+ public String getStyle() throws MIRAEException {
+ return style;
+ }
+
+ /**
+ * Operation Name is specified
+ *
+ * @param operationName
+ * @throws MIRAEException
+ */
+ public void setOperationName(QName operationName)throws MIRAEException {
+ this.operationName = operationName;
+ }
+
+ /**
+ * Specify the return type category which is used by the Decoder
+ * @param returnCategory
+ * @throws MIRAEException
+ */
+ public void setReturnCategory(int returnCategory)throws MIRAEException {
+ this.returnCategory = returnCategory;
+ }
+
+ /**
+ * Service name is defined here
+ * @param portType
+ * @throws MIRAEException
+ */
+ public void setSoapActonURI(QName soapAction) throws MIRAEException {
+ this.soapAction = soapAction;
+ }
+
+ /**
+ * This Return type is used by the Decoder to decode the output object
+ * @param returnType
+ * @throws MIRAEException
+ */
+ public void setReturnType(InOutParameter returnType)throws MIRAEException {
+ this.returnType = returnType;
+ }
+
+ /**
+ * set the validation code of the return type
+ * @param validationCode
+ * @throws MIRAEException
+ */
+ public void setValidationCode(String validationCode)throws MIRAEException {
+ this.validationCode = validationCode;
+ }
+
+ /**
+ * End point uri
+ * @param uri
+ * @throws MIRAEException
+ */
+ public void setTargetEndpointAddress(String uri)throws MIRAEException {
+ this.uri=uri;
+ }
+
+ /**
+ * This method is the real implementation for an engine with the
+ * SAXparser.
+ * InputParameterInfo array is created using the input parameters.
+ * Connection to the server is made by HttpConnection.
+ * OutputStream is opened and SOAP request is serialized first
+ * Then the OutputStream is closed and the InputStream is opened
+ * SAX paser is used by this class to parse the SOAP response
+ *
+ * @param operationName
+ * @param inputParams
+ * @return InOutParameter
+ * @throws MIRAEException
+ */
+ public InOutParameter invoke() throws MIRAEException {
+
+ /* Variable for checking whether there is any fault in the SOAP Response */
+ int responseCode;
+
+ try {
+ /* InputParameterInfo Array is created */
+ createInputParameterInfoArray();
+
+ /* Connection to the server is created */
+ httpConnection = (HttpConnection) Connector.open(uri);
+
+ /* Output stream for the request is set up */
+ outputStream = setupReqStream(httpConnection);
+
+ /* Soap Request is serialized */
+ Encoder.serialize(this.operationName, this.inInfo, this.style, this.outputStream);
+
+ /* The Output stream is closed here to avoid collision with the Input stream */
+ closeOutputStream();
+
+ /* Input stream is opened */
+ inputStream = httpConnection.openInputStream();
+
+ /* Get the response Code from the HTTP header */
+ responseCode = httpConnection.getResponseCode();
+
+ /* SOAP Response is deserialized */
+ Decoder decoder = new Decoder(this.returnType, this.returnCategory, this.validationCode);
+ decoder.decode(this.inputStream);
+
+ /* If the responseCode is not 200, Exception is thrown with SOAP fault */
+ if ( responseCode != HttpConnection.HTTP_OK ) {
+ throw new Exception("SOAP Fault\n\n" + decoder.getFaultCode()
+ + "\n\n" + decoder.getFaultString());
+ }
+
+ /* If the return type is not null, the result is returned */
+ if ( this.returnType != null ) {
+ return decoder.getParam();
+ } else {
+ return null;
+ }
+
+ } catch (Throwable t) {
+
+ /* Re-throw whatever exception occurs as a new MIRAEException */
+ throw new MIRAEException(t.toString());
+
+ } finally {
+ /* Output stream, Input stream and the Http connection are closed */
+ closeOutputStream();
+ closeInputStream();
+ closeHttpConnection();
+ }
+ }
+
+ /**
+ * Create the InputParameterInfo array using the InputParameterInfo
+ * elements of the inParams vector
+ *
+ * @throws MIRAEException
+ */
+ private void createInputParameterInfoArray() throws MIRAEException {
+ this.inInfo = new InputParameterInfo[inParams.size()];
+
+ for (int i = 0; i < inParams.size(); i++) {
+ this.inInfo[i] = ((InputParameterInfo) inParams.elementAt(i));
+ }
+ }
+
+ /**
+ * Close the Input stream
+ *
+ * @throws MIRAEException
+ */
+ private void closeInputStream() throws MIRAEException {
+ if ( this.inputStream != null ) {
+ try {
+ this.inputStream.close();
+ this.inputStream = null;
+ } catch (Throwable t) {;}
+ }
+ }
+
+ /**
+ * Close the Output stream
+ *
+ * @throws MIRAEException
+ */
+ private void closeOutputStream() throws MIRAEException {
+ if ( this.outputStream != null ) {
+ try {
+ this.outputStream.close();
+ this.outputStream = null;
+ } catch (Throwable t) {;}
+ }
+ }
+
+ /**
+ * Close the Http Connection
+ *
+ * @throws MIRAEException
+ */
+ private void closeHttpConnection() throws MIRAEException {
+ if ( this.httpConnection != null ) {
+ try {
+ this.httpConnection.close();
+ this.httpConnection = null;
+ } catch (Throwable t) {;}
+ }
+ }
+
+ /**
+ * The request properties for the HttpConnection are set
+ * @param http
+ * @return
+ * @throws IOException
+ */
+ private OutputStream setupReqStream(HttpConnection http) throws IOException {
+ http.setRequestMethod(HttpConnection.POST);
+ http.setRequestProperty(Constants.HEADER_USER_AGENT,Constants.HEADER_CLIENT);
+ http.setRequestProperty(Constants.HEADER_CONTENT_LANGUAGE,Constants.HEADER_ACCEPT_EN);
+ http.setRequestProperty(Constants.HEADER_CONTENT_TYPE, Constants.HEADER_ACCEPT_TEXT_XML);
+ http.setRequestProperty(Constants.HEADER_SOAP_ACTION, soapAction.getLocalPart());
+
+ return http.openOutputStream();
+ }
+
+}