You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/01/06 20:46:52 UTC
svn commit: r366555 [1/4] - in /webservices/axis2/trunk/java/modules:
adb/src/org/apache/axis2/databinding/types/
adb/src/org/apache/axis2/databinding/utils/
codegen/src/org/apache/axis2/schema/
codegen/src/org/apache/axis2/schema/i18n/ codegen/src/org...
Author: dims
Date: Fri Jan 6 11:46:16 2006
New Revision: 366555
URL: http://svn.apache.org/viewcvs?rev=366555&view=rev
Log:
- Remove javadoc warnings completely.
- spelling change OPERATOIN -> OPERATION
- spelling change scheam -> schema
Modified:
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Language.java
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Time.java
webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/URLProcessor.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMapper.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/CodegenMessages.java
webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/ProjectResourceBundle.java
webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/JavaUtils.java
webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/Loader.java
webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/XMLUtils.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MEPClient.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterImpl.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/ParameterIncludeImpl.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PhaseRule.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/PolicyInclude.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportInDescription.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/TransportOutDescription.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/fault/FaultSubcode.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/handlers/AbstractHandler.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPConstants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportReceiver.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/SimpleHttpServerConnection.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSConnectorFactory.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSEndpoint.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/QueueConnector.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/TopicConnector.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/URL.java
webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/om/impl/dom/ChildNode.java
webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java
webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/om/impl/dom/NamedNodeMapImpl.java
webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPHeaderBlockImpl.java
webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/PrefixedQName.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/handler/config/InflowConfiguration.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/TrustException.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/AppliesTo.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/BinarySecret.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/Claims.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/IssueRequestSecurityToken.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/Lifetime.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/ValueToken.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/ant/AntCodegenTask.java
webservices/axis2/trunk/java/modules/tool/src/org/apache/axis2/tool/core/ClassFileHandler.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WSDL.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/TypeTable.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/writer/WOMtoWSDL11Writer.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/utils/IOUtils.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/serialize/StreamWriterToContentHandlerConverter.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFault.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFaultCode.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPHeader.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPElement.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/factory/SOAPLinkedListImplFactory.java
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Language.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Language.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Language.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Language.java Fri Jan 6 11:46:16 2006
@@ -1,66 +1,67 @@
-/*
- * 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.axis2.databinding.types;
-
-
-/**
- * Custom class for supporting XSD data type language
- * language represents natural language identifiers as defined by [RFC 1766].
- * The value space of language is the set of all strings that are valid language identifiers
- * as defined in the language identification section of [XML 1.0 (Second Edition)].
- * The lexical space of language is the set of all strings that are valid language identifiers
- * as defined in the language identification section of [XML 1.0 (Second Edition)].
- * The base type of language is token.
- *
- * @see <a href="http://www.w3.org/TR/xmlschema-2/#language">XML Schema 3.3.3</a>
- */
-public class Language extends Token {
-
- private static final long serialVersionUID = -4105320293090087959L;
-
- public Language() {
- super();
- }
-
- /**
- * ctor for Language
- * @exception IllegalArgumentException will be thrown if validation fails
- */
- public Language(String stValue) throws IllegalArgumentException {
- try {
- setValue(stValue);
- }
- catch (IllegalArgumentException e) {
- // recast normalizedString exception as token exception
- throw new IllegalArgumentException(
-// Messages.getMessage("badLanguage00") +
- "data=[" + stValue + "]");
- }
- }
-
- /**
- *
- * validate the value against the xsd definition
- * TODO
- * @see <a href="http://www.ietf.org/rfc/rfc1766.txt">RFC1766</a>
- * Language-Tag = Primary-tag *( "-" Subtag )
- * Primary-tag = 1*8ALPHA
- * Subtag = 1*8ALPHA
- */
- public static boolean isValid(String stValue) {
- return true;
- }
-}
+/*
+ * 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.axis2.databinding.types;
+
+
+/**
+ * Custom class for supporting XSD data type language
+ * language represents natural language identifiers as defined by [RFC 1766].
+ * The value space of language is the set of all strings that are valid language identifiers
+ * as defined in the language identification section of [XML 1.0 (Second Edition)].
+ * The lexical space of language is the set of all strings that are valid language identifiers
+ * as defined in the language identification section of [XML 1.0 (Second Edition)].
+ * The base type of language is token.
+ *
+ * @see <a href="http://www.w3.org/TR/xmlschema-2/#language">XML Schema 3.3.3</a>
+ */
+public class Language extends Token {
+
+ private static final long serialVersionUID = -4105320293090087959L;
+
+ public Language() {
+ super();
+ }
+
+ /**
+ * ctor for Language
+ * @exception IllegalArgumentException will be thrown if validation fails
+ */
+ public Language(String stValue) throws IllegalArgumentException {
+ try {
+ setValue(stValue);
+ }
+ catch (IllegalArgumentException e) {
+ // recast normalizedString exception as token exception
+ throw new IllegalArgumentException(
+// Messages.getMessage("badLanguage00") +
+ "data=[" + stValue + "]");
+ }
+ }
+
+ /**
+ *
+ * Validates the value against the xsd definition.
+ * Language-Tag = Primary-tag *( "-" Subtag )
+ * Primary-tag = 1*8ALPHA
+ * Subtag = 1*8ALPHA
+ * TODO
+ * @see <a href="http://www.ietf.org/rfc/rfc1766.txt">RFC1766</a>
+ *
+ */
+ public static boolean isValid(String stValue) {
+ return true;
+ }
+}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Time.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Time.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Time.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/types/Time.java Fri Jan 6 11:46:16 2006
@@ -1,252 +1,252 @@
-/*
- * Copyright 2002-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.axis2.databinding.types;
-
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-/**
- * Class that represents the xsd:time XML Schema type
- */
-public class Time implements java.io.Serializable {
-
- private static final long serialVersionUID = -9022201555535589908L;
-
- private Calendar _value;
-
- /**
- * a shared java.text.SimpleDateFormat instance used for parsing the basic
- * component of the timestamp
- */
- private static SimpleDateFormat zulu =
- new SimpleDateFormat("HH:mm:ss.SSS'Z'");
-
- // We should always format dates in the GMT timezone
- static {
- zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
- }
-
-
- /**
- * Initialize with a Calender, year month and date are ignored
- */
- public Time(Calendar value) {
- this._value = value;
- _value.set(0,0,0); // ignore year, month, date
- }
-
- /**
- * Converts a string formatted as HH:mm:ss[.SSS][+/-offset]
- */
- public Time(String value) throws NumberFormatException {
- _value = makeValue(value);
- }
-
- /**
- * return the time as a calendar: ignore the year, month and date fields
- * @return calendar value; may be null
- */
- public Calendar getAsCalendar() {
- return _value;
- }
-
- /**
- * set the time; ignore year, month, date
- * @param date
- */
- public void setTime(Calendar date) {
- this._value = date;
- _value.set(0,0,0); // ignore year, month, date
- }
-
- /**
- * set the time from a date instance
- * @param date
- */
- public void setTime(Date date) {
- _value.setTime(date);
- _value.set(0,0,0); // ignore year, month, date
- }
-
- /**
- * Utility function that parses xsd:time strings and returns a Date object
- */
- private Calendar makeValue(String source) throws NumberFormatException {
- Calendar calendar = Calendar.getInstance();
- Date date;
-
- validateSource(source);
-
- // convert what we have validated so far
- date = ParseHoursMinutesSeconds(source);
-
- int pos = 8; // The "." in hh:mm:ss.sss
-
- // parse optional milliseconds
- if ( source != null ) {
- if (pos < source.length() && source.charAt(pos)=='.') {
- int milliseconds = 0;
- int start = ++pos;
- while (pos<source.length() &&
- Character.isDigit(source.charAt(pos))) {
- pos++;
- }
-
-
- String decimal=source.substring(start,pos);
- if (decimal.length()==3) {
- milliseconds=Integer.parseInt(decimal);
- } else if (decimal.length() < 3) {
- milliseconds=Integer.parseInt((decimal+"000")
- .substring(0,3));
- } else {
- milliseconds=Integer.parseInt(decimal.substring(0,3));
- if (decimal.charAt(3)>='5') {
- ++milliseconds;
- }
- }
-
- // add milliseconds to the current date
- date.setTime(date.getTime()+milliseconds);
- }
-
- // parse optional timezone
- if (pos+5 < source.length() &&
- (source.charAt(pos)=='+' || (source.charAt(pos)=='-'))) {
- if (!Character.isDigit(source.charAt(pos+1)) ||
- !Character.isDigit(source.charAt(pos+2)) ||
- source.charAt(pos+3) != ':' ||
- !Character.isDigit(source.charAt(pos+4)) ||
- !Character.isDigit(source.charAt(pos+5)))
- {
- throw new NumberFormatException();
- //Messages.getMessage("badTimezone00"));
- }
-
- int hours = (source.charAt(pos+1)-'0')*10
- +source.charAt(pos+2)-'0';
- int mins = (source.charAt(pos+4)-'0')*10
- +source.charAt(pos+5)-'0';
- int milliseconds = (hours*60+mins)*60*1000;
-
- // subtract milliseconds from current date to obtain GMT
- if (source.charAt(pos)=='+') {
- milliseconds=-milliseconds;
- }
- date.setTime(date.getTime()+milliseconds);
- pos+=6;
- }
-
- if (pos < source.length() && source.charAt(pos)=='Z') {
- pos++;
- calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
- }
-
- if (pos < source.length()) {
- throw new NumberFormatException();
- //Messages.getMessage("badChars00"));
- }
- }
-
- calendar.setTime(date);
- calendar.set(0,0,0); // ignore year, month, date
-
- return calendar;
- }
-
- /**
- * parse the hours, minutes and seconds of a string, by handing it off to
- * the java runtime.
- * The relevant code will return null if a null string is passed in, so this
- * code may return a null date in response
- * @param source
- * @return
- * @throws NumberFormatException in the event of trouble
- */
- private static Date ParseHoursMinutesSeconds(String source) {
- Date date;
- try {
- synchronized (zulu) {
- String fulltime = source == null ? null :
- (source.substring(0,8)+".000Z");
- date = zulu.parse(fulltime);
- }
- } catch (Exception e) {
- throw new NumberFormatException(e.toString());
- }
- return date;
- }
-
- /**
- * validate the source
- * @param source
- */
- private void validateSource(String source) {
- // validate fixed portion of format
- if ( source != null ) {
- if (source.charAt(2) != ':' || source.charAt(5) != ':') {
- throw new NumberFormatException();
- //Messages.getMessage("badTime00"));
- }
- if (source.length() < 8) {
- throw new NumberFormatException();
- //Messages.getMessage("badTime00"));
- }
- }
- }
-
- /**
- * stringify method returns the time as it would be in GMT, only accurate to the
- * second...millis probably get lost.
- * @return
- */
- public String toString() {
- if(_value==null) {
- return "unassigned Time";
- }
- synchronized (zulu) {
- return zulu.format(_value.getTime());
- }
-
- }
-
- public boolean equals(Object obj) {
- if (obj == null) return false;
- if (!(obj instanceof Time)) return false;
- Time other = (Time) obj;
- if (this == obj) return true;
-
- boolean _equals;
- _equals = ((_value == null && other._value == null) ||
- (_value != null &&
- _value.getTime().equals(other._value.getTime())));
-
- return _equals;
-
- }
-
- /**
- * Returns the hashcode of the underlying calendar.
- *
- * @return an <code>int</code> value
- */
- public int hashCode() {
- return _value == null ? 0 : _value.hashCode();
- }
-}
+/*
+ * Copyright 2002-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.axis2.databinding.types;
+
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+/**
+ * Class that represents the xsd:time XML Schema type
+ */
+public class Time implements java.io.Serializable {
+
+ private static final long serialVersionUID = -9022201555535589908L;
+
+ private Calendar _value;
+
+ /**
+ * a shared java.text.SimpleDateFormat instance used for parsing the basic
+ * component of the timestamp
+ */
+ private static SimpleDateFormat zulu =
+ new SimpleDateFormat("HH:mm:ss.SSS'Z'");
+
+ // We should always format dates in the GMT timezone
+ static {
+ zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
+ }
+
+
+ /**
+ * Initializes with a Calender. Year, month and date are ignored.
+ */
+ public Time(Calendar value) {
+ this._value = value;
+ _value.set(0,0,0); // ignore year, month, date
+ }
+
+ /**
+ * Converts a string formatted as HH:mm:ss[.SSS][+/-offset]
+ */
+ public Time(String value) throws NumberFormatException {
+ _value = makeValue(value);
+ }
+
+ /**
+ * Returns the time as a calendar. Ignores the year, month and date fields.
+ * @return Returns calendar value; may be null.
+ */
+ public Calendar getAsCalendar() {
+ return _value;
+ }
+
+ /**
+ * Sets the time; ignores year, month, date
+ * @param date
+ */
+ public void setTime(Calendar date) {
+ this._value = date;
+ _value.set(0,0,0); // ignore year, month, date
+ }
+
+ /**
+ * Sets the time from a date instance.
+ * @param date
+ */
+ public void setTime(Date date) {
+ _value.setTime(date);
+ _value.set(0,0,0); // ignore year, month, date
+ }
+
+ /**
+ * Utility function that parses xsd:time strings and returns a Date object
+ */
+ private Calendar makeValue(String source) throws NumberFormatException {
+ Calendar calendar = Calendar.getInstance();
+ Date date;
+
+ validateSource(source);
+
+ // convert what we have validated so far
+ date = ParseHoursMinutesSeconds(source);
+
+ int pos = 8; // The "." in hh:mm:ss.sss
+
+ // parse optional milliseconds
+ if ( source != null ) {
+ if (pos < source.length() && source.charAt(pos)=='.') {
+ int milliseconds = 0;
+ int start = ++pos;
+ while (pos<source.length() &&
+ Character.isDigit(source.charAt(pos))) {
+ pos++;
+ }
+
+
+ String decimal=source.substring(start,pos);
+ if (decimal.length()==3) {
+ milliseconds=Integer.parseInt(decimal);
+ } else if (decimal.length() < 3) {
+ milliseconds=Integer.parseInt((decimal+"000")
+ .substring(0,3));
+ } else {
+ milliseconds=Integer.parseInt(decimal.substring(0,3));
+ if (decimal.charAt(3)>='5') {
+ ++milliseconds;
+ }
+ }
+
+ // add milliseconds to the current date
+ date.setTime(date.getTime()+milliseconds);
+ }
+
+ // parse optional timezone
+ if (pos+5 < source.length() &&
+ (source.charAt(pos)=='+' || (source.charAt(pos)=='-'))) {
+ if (!Character.isDigit(source.charAt(pos+1)) ||
+ !Character.isDigit(source.charAt(pos+2)) ||
+ source.charAt(pos+3) != ':' ||
+ !Character.isDigit(source.charAt(pos+4)) ||
+ !Character.isDigit(source.charAt(pos+5)))
+ {
+ throw new NumberFormatException();
+ //Messages.getMessage("badTimezone00"));
+ }
+
+ int hours = (source.charAt(pos+1)-'0')*10
+ +source.charAt(pos+2)-'0';
+ int mins = (source.charAt(pos+4)-'0')*10
+ +source.charAt(pos+5)-'0';
+ int milliseconds = (hours*60+mins)*60*1000;
+
+ // subtract milliseconds from current date to obtain GMT
+ if (source.charAt(pos)=='+') {
+ milliseconds=-milliseconds;
+ }
+ date.setTime(date.getTime()+milliseconds);
+ pos+=6;
+ }
+
+ if (pos < source.length() && source.charAt(pos)=='Z') {
+ pos++;
+ calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
+ }
+
+ if (pos < source.length()) {
+ throw new NumberFormatException();
+ //Messages.getMessage("badChars00"));
+ }
+ }
+
+ calendar.setTime(date);
+ calendar.set(0,0,0); // ignore year, month, date
+
+ return calendar;
+ }
+
+ /**
+ * Parses the hours, minutes and seconds of a string, by handing it off to
+ * the java runtime.
+ * The relevant code returns null if a null string is passed in, so this
+ * code may return a null date in response.
+ * @param source
+ * @return Returns Date.
+ * @throws NumberFormatException in the event of trouble
+ */
+ private static Date ParseHoursMinutesSeconds(String source) {
+ Date date;
+ try {
+ synchronized (zulu) {
+ String fulltime = source == null ? null :
+ (source.substring(0,8)+".000Z");
+ date = zulu.parse(fulltime);
+ }
+ } catch (Exception e) {
+ throw new NumberFormatException(e.toString());
+ }
+ return date;
+ }
+
+ /**
+ * Validates the source.
+ * @param source
+ */
+ private void validateSource(String source) {
+ // validate fixed portion of format
+ if ( source != null ) {
+ if (source.charAt(2) != ':' || source.charAt(5) != ':') {
+ throw new NumberFormatException();
+ //Messages.getMessage("badTime00"));
+ }
+ if (source.length() < 8) {
+ throw new NumberFormatException();
+ //Messages.getMessage("badTime00"));
+ }
+ }
+ }
+
+ /**
+ * Returns the time as it would be in GMT. This is accurate to the
+ * seconds. Milliseconds probably gets lost.
+ * @return Returns String.
+ */
+ public String toString() {
+ if(_value==null) {
+ return "unassigned Time";
+ }
+ synchronized (zulu) {
+ return zulu.format(_value.getTime());
+ }
+
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null) return false;
+ if (!(obj instanceof Time)) return false;
+ Time other = (Time) obj;
+ if (this == obj) return true;
+
+ boolean _equals;
+ _equals = ((_value == null && other._value == null) ||
+ (_value != null &&
+ _value.getTime().equals(other._value.getTime())));
+
+ return _equals;
+
+ }
+
+ /**
+ * Returns the hashcode of the underlying calendar.
+ *
+ * @return Returns an <code>int</code> value.
+ */
+ public int hashCode() {
+ return _value == null ? 0 : _value.hashCode();
+ }
+}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Fri Jan 6 11:46:16 2006
@@ -285,7 +285,7 @@
* Converts a given string into a date.
* Code from Axis1 DateDeserializer.
*
- * @param s
+ * @param source
* @return Returns Date.
*/
public static Date convertTodate(String source) {
@@ -438,7 +438,7 @@
/**
* Code from Axis1 code base
* Note - We only follow the convention in the latest schema spec
- * @param s
+ * @param source
* @return Returns Calendar.
* @throws Exception
*/
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java Fri Jan 6 11:46:16 2006
@@ -23,8 +23,8 @@
*/
/**
- * This is a class used as a holder to pass on the meta information to the bean writer
- * This meta information will be used by the writer to write the databinding conversion code
+ * This class is used as a holder to pass on the meta information to the bean writer.
+ * This meta information is used by the writer to write the databinding conversion code.
* Note - Metainfholders are not meant to be reused!!!. They are per-class basis and are strictly
* not thread safe!!!!
*/
@@ -43,16 +43,16 @@
private Map qNameOrderMap = new HashMap();
/**
- * get the anon status
+ * Gets the anonymous status.
*
- * @return
+ * @return Returns boolean.
*/
public boolean isAnonymous() {
return anonymous;
}
/**
- * Set the anonymous flag
+ * Sets the anonymous flag.
*
* @param anonymous
*/
@@ -61,8 +61,8 @@
}
/**
- * set the extensions base class name. Valid only when the isExtension
- * retruns true
+ * Sets the extensions base class name. Valid only when the isExtension
+ * returns true.
*
* @return Returns String.
*/
@@ -71,8 +71,8 @@
}
/**
- * set the extensions base class name. Valid only when the isExtension
- * retruns true
+ * Sets the extensions base class name. Valid only when the isExtension
+ * returns true.
*
* @param extensionClassName
*/
@@ -81,7 +81,7 @@
}
/**
- * get the extension status
+ * Gets the extension status.
*
* @return Returns boolean.
*/
@@ -90,7 +90,7 @@
}
/**
- * set the extension status
+ * Sets the extension status.
*
* @param extension
*/
@@ -99,7 +99,7 @@
}
/**
- * ge the ordered statu
+ * Gets the ordered status.
*
* @return Returns boolean.
*/
@@ -108,8 +108,7 @@
}
/**
- * set the ordered flag. this marks whether the
- * items are ordered or not
+ * Sets the ordered flag.
*
* @param ordered
*/
@@ -118,7 +117,7 @@
}
/**
- * Register a mapping
+ * Registers a mapping.
*
* @param qName
* @param schemaName
@@ -129,7 +128,7 @@
}
/**
- * Register a mapping
+ * Registers a mapping.
*
* @param qName
* @param schemaName
@@ -144,7 +143,7 @@
}
/**
- * Get the schema name for the given QName
+ * Gets the schema name for the given QName.
*
* @param eltQName
* @return Returns QName.
@@ -154,7 +153,7 @@
}
/**
- * get the class name for the QName
+ * Gets the class name for the QName.
*
* @param eltQName
* @return Returns String.
@@ -164,7 +163,7 @@
}
/**
- * Get whether a given QName is an attribute
+ * Gets whether a given QName is an attribute
*
* @param qName
* @return Returns boolean.
@@ -175,7 +174,7 @@
}
/**
- * Get whether a given QName represents a anyType
+ * Gets whether a given QName represents a anyType
*
* @param qName
* @return Returns boolean.
@@ -186,7 +185,7 @@
}
/**
- * Get whether a given QName refers to an array
+ * Gets whether a given QName refers to an array.
*
* @param qName
* @return Returns boolean.
@@ -197,7 +196,7 @@
}
/**
- * Get whether a given QName has the any attribute status
+ * Gets whether a given QName has the any attribute status.
*
* @param qName
* @return Returns boolean.
@@ -222,7 +221,7 @@
}
/**
- * add the maxOccurs associated with a QName
+ * Adds the minOccurs associated with a QName.
*
* @param qName
* @param minOccurs
@@ -232,7 +231,7 @@
}
/**
- * register a QName for the order
+ * Registers a QName for the order.
*
* @param qName
* @param index
@@ -242,10 +241,10 @@
}
/**
- * Add the minOccurs associated with a QName
+ * Adds the minOccurs associated with a QName.
*
* @param qName
- * @return
+ * @return Returns long.
*/
public long getMinOccurs(QName qName) {
Long l = (Long) this.qNameMinOccursCountMap.get(qName);
@@ -253,7 +252,7 @@
}
/**
- * get the maxOccurs associated with a QName
+ * Gets the maxOccurs associated with a QName.
*
* @param qName
* @return Returns long.
@@ -264,7 +263,7 @@
}
/**
- * Add the maxOccurs associated with a QName
+ * Adds the maxOccurs associated with a QName.
*
* @param qName
* @param maxOccurs
@@ -282,7 +281,7 @@
}
/**
- * get the QName array - may not be ordered
+ * Gets the QName array - may not be ordered.
*
* @return Returns QName[].
*/
@@ -292,7 +291,7 @@
}
/**
- * Get the ordered QName array - useful in sequences where the order needs to be preserved
+ * Gets the ordered QName array - useful in sequences where the order needs to be preserved
* Note - #registerQNameIndex needs to be called if this is to work properly!
*
* @return Returns QName[].
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/i18n/SchemaCompilerMessages.java Fri Jan 6 11:46:16 2006
@@ -1,162 +1,163 @@
-package org.apache.axis2.schema.i18n;
-
-import org.apache.axis2.i18n.MessageBundle;
-import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.i18n.MessagesConstants;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/*
- * Copyright 2004,2005 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.
- */
-
-/**
- * @see Messages. The implementation is the same but just the thisClass static reference
- * has SchemaCompilerMessages.class
- */
-public class SchemaCompilerMessages {
-
- private static Class thisClass = SchemaCompilerMessages.class;
-
- private static final String projectName = MessagesConstants.projectName;
-
- private static final String resourceName = MessagesConstants.resourceName;
- private static final Locale locale = MessagesConstants.locale;
-
- private static final String packageName = getPackage(thisClass.getName());
- private static final ClassLoader classLoader = thisClass.getClassLoader();
-
- private static final ResourceBundle parent =
- (MessagesConstants.rootPackageName.equals(packageName))
- ? null
- : MessagesConstants.rootBundle;
-
-
- /**
- * ** NO NEED TO CHANGE ANYTHING BELOW ****
- */
-
- private static final MessageBundle messageBundle =
- new MessageBundle(projectName, packageName, resourceName,
- locale, classLoader, parent);
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @return The formatted message
- */
- public static String getMessage(String key)
- throws MissingResourceException {
- return messageBundle.getMessage(key);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @param arg3 The argument to place in variable {3}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2, arg3);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @param arg3 The argument to place in variable {3}
- * @param arg4 The argument to place in variable {4}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3, String arg4)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2, arg3, arg4);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param args An array of objects to place in corresponding variables
- * @return The formatted message
- */
- public static String getMessage(String key, String[] args)
- throws MissingResourceException {
- return messageBundle.getMessage(key, args);
- }
-
- public static ResourceBundle getResourceBundle() {
- return messageBundle.getResourceBundle();
- }
-
- public static MessageBundle getMessageBundle() {
- return messageBundle;
- }
-
- private static String getPackage(String name) {
- return name.substring(0, name.lastIndexOf('.')).intern();
- }
-
-}
+package org.apache.axis2.schema.i18n;
+
+import org.apache.axis2.i18n.MessageBundle;
+import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.i18n.MessagesConstants;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/*
+ * Copyright 2004,2005 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.
+ */
+
+/**
+ * @see org.apache.axis2.i18n.Messages
+ * The implementation is the same but just thisClass static reference
+ * has SchemaCompilerMessages.class
+ */
+public class SchemaCompilerMessages {
+
+ private static Class thisClass = SchemaCompilerMessages.class;
+
+ private static final String projectName = MessagesConstants.projectName;
+
+ private static final String resourceName = MessagesConstants.resourceName;
+ private static final Locale locale = MessagesConstants.locale;
+
+ private static final String packageName = getPackage(thisClass.getName());
+ private static final ClassLoader classLoader = thisClass.getClassLoader();
+
+ private static final ResourceBundle parent =
+ (MessagesConstants.rootPackageName.equals(packageName))
+ ? null
+ : MessagesConstants.rootBundle;
+
+
+ /**
+ * ** NO NEED TO CHANGE ANYTHING BELOW ****
+ */
+
+ private static final MessageBundle messageBundle =
+ new MessageBundle(projectName, packageName, resourceName,
+ locale, classLoader, parent);
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key);
+ }
+
+ /**
+ * Get a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2);
+ }
+
+ /**
+ * Get a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @param arg3 The argument to place in variable {3}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2, arg3);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @param arg3 The argument to place in variable {3}
+ * @param arg4 The argument to place in variable {4}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3, String arg4)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2, arg3, arg4);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param args An array of objects to place in corresponding variables
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String[] args)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, args);
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return messageBundle.getResourceBundle();
+ }
+
+ public static MessageBundle getMessageBundle() {
+ return messageBundle;
+ }
+
+ private static String getPackage(String name) {
+ return name.substring(0, name.lastIndexOf('.')).intern();
+ }
+
+}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java Fri Jan 6 11:46:16 2006
@@ -1,80 +1,80 @@
-package org.apache.axis2.schema.util;
-
-import org.apache.axis2.schema.SchemaCompiler;
-import org.apache.axis2.schema.SchemaConstants;
-import org.apache.axis2.schema.typemap.TypeMap;
-import org.apache.axis2.schema.writer.BeanWriter;
-
-import java.util.Properties;
-/*
- * Copyright 2004,2005 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.
- */
-
-/**
- * Loads the properties for the schema compiler
- */
-public class SchemaPropertyLoader {
- private static String beanTemplate = null;
- private static BeanWriter beanWriterInstance = null;
- private static TypeMap typeMapperInstance = null;
- private static Properties propertyMap;
-
- static {
- try {
- //load the properties
- Properties props = new Properties();
- props.load(SchemaCompiler.class.getResourceAsStream(SchemaConstants.SchemaPropertyNames.SCHEMA_COMPILER_PROPERTIES));
-
- String beanWriterClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_KEY);
- if (beanWriterClassName != null) {
- beanWriterInstance = (BeanWriter) Class.forName(beanWriterClassName).newInstance();
- }
-
- String typeMapperClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TYPEMAP_KEY);
- if (typeMapperClassName != null) {
- typeMapperInstance = (TypeMap) Class.forName(typeMapperClassName).newInstance();
- }
-
- beanTemplate = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY);
-
- //set the props as the property map
- propertyMap = props;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
-
- }
-
- /**
- * Exposes the whole property set
- * @return
- */
- public static Properties getPropertyMap() {
- return propertyMap;
- }
-
- public static String getBeanTemplate() {
- return beanTemplate;
- }
-
- public static BeanWriter getBeanWriterInstance() {
- return beanWriterInstance;
- }
-
- public static TypeMap getTypeMapperInstance() {
- return typeMapperInstance;
- }
-}
+package org.apache.axis2.schema.util;
+
+import org.apache.axis2.schema.SchemaCompiler;
+import org.apache.axis2.schema.SchemaConstants;
+import org.apache.axis2.schema.typemap.TypeMap;
+import org.apache.axis2.schema.writer.BeanWriter;
+
+import java.util.Properties;
+/*
+ * Copyright 2004,2005 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.
+ */
+
+/**
+ * Loads the properties for the schema compiler.
+ */
+public class SchemaPropertyLoader {
+ private static String beanTemplate = null;
+ private static BeanWriter beanWriterInstance = null;
+ private static TypeMap typeMapperInstance = null;
+ private static Properties propertyMap;
+
+ static {
+ try {
+ //load the properties
+ Properties props = new Properties();
+ props.load(SchemaCompiler.class.getResourceAsStream(SchemaConstants.SchemaPropertyNames.SCHEMA_COMPILER_PROPERTIES));
+
+ String beanWriterClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_KEY);
+ if (beanWriterClassName != null) {
+ beanWriterInstance = (BeanWriter) Class.forName(beanWriterClassName).newInstance();
+ }
+
+ String typeMapperClassName = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TYPEMAP_KEY);
+ if (typeMapperClassName != null) {
+ typeMapperInstance = (TypeMap) Class.forName(typeMapperClassName).newInstance();
+ }
+
+ beanTemplate = props.getProperty(SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY);
+
+ //set the props as the property map
+ propertyMap = props;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+
+ }
+
+ /**
+ * Exposes the whole property set
+ * @return Returns Properties.
+ */
+ public static Properties getPropertyMap() {
+ return propertyMap;
+ }
+
+ public static String getBeanTemplate() {
+ return beanTemplate;
+ }
+
+ public static BeanWriter getBeanWriterInstance() {
+ return beanWriterInstance;
+ }
+
+ public static TypeMap getTypeMapperInstance() {
+ return typeMapperInstance;
+ }
+}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/URLProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/URLProcessor.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/URLProcessor.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/URLProcessor.java Fri Jan 6 11:46:16 2006
@@ -23,10 +23,10 @@
public static final String DEFAULT_PACKAGE = "org.apache.axis2";
/**
- * Method makePackageName
+ * Method makePackageName.
*
* @param namespace
- * @return
+ * @return Returns String.
*/
public static String makePackageName(String namespace) {
@@ -91,8 +91,8 @@
/**
- * Massage <tt>word</tt> into a form suitable for use in a Java package name.
- * Append it to the target string buffer with a <tt>.</tt> delimiter iff
+ * Massages <tt>word</tt> into a form suitable for use in a Java package name.
+ * Appends it to the target string buffer with a <tt>.</tt> delimiter if
* <tt>word</tt> is not the first word in the package name.
*
* @param sb the buffer to append to
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Fri Jan 6 11:46:16 2006
@@ -96,7 +96,7 @@
/**
* Gets the policy map.
*
- * @return
+ * @return Returns Map.
*/
public Map getPolicyMap() {
return policyMap;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMapper.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMapper.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMapper.java Fri Jan 6 11:46:16 2006
@@ -29,40 +29,40 @@
public static final String DEFAULT_CLASS_NAME = OMElement.class.getName();
/**
- * returns whether the mapping is the object type or the normal class name type
- * @return
+ * Returns whether the mapping is the object type or the normal class name type
+ * @return Returns boolean.
*/
public boolean isObjectMappingPresent();
/**
- * Get the type mapping class name
+ * Gets the type mapping class name.
*
* @param qname name of the XML element to be mapped
- * @return a string that represents the particular type
+ * @return Returns a string that represents the particular type.
*/
public String getTypeMappingName(QName qname);
/**
- * Get the type mapping Object
+ * Gets the type mapping Object.
*
* @param qname name of the XML element to be mapped
- * @return an Object that represents the particular class in a pre specified form.
- * it can be a specific format to the databinding framework used
+ * @return Returns an Object that represents the particular class in a pre specified form.
+ * It can be a specific format to the databinding framework used.
* This allows tight integrations with the databinding framework, allowing the emitter
- * to write the databinding classes in his own way
+ * to write the databinding classes in its own way.
*/
public Object getTypeMappingObject(QName qname);
/**
- * Get the parameter name
+ * Gets the parameter name.
*
* @param qname name of the XML element to get a parameter
- * @return a unique parameter name
+ * @return Returns a unique parameter name.
*/
public String getParameterName(QName qname);
/**
- * Adds a type mapping name to the type mapper
+ * Adds a type mapping name to the type mapper.
*
* @param qname
* @param value
@@ -71,7 +71,7 @@
public void addTypeMappingName(QName qname, String value);
/**
- * Adds a type mapping object to the type mapper
+ * Adds a type mapping object to the type mapper.
*
* @param qname the xml Qname that this type refers to
* @param value the type mapping object
@@ -80,13 +80,13 @@
public void addTypeMappingObject(QName qname, Object value);
/**
- * @return a map containing all type mapping names
+ * @return Returns a map containing all type mapping names
* i.e. Qname to classname
*/
public Map getAllMappedNames();
/**
- * @return a map containing all type mapping model objects
+ * @return Returns a map containing all type mapping model objects
* i.e. Qname to model objects
*/
public Map getAllMappedObjects();
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java Fri Jan 6 11:46:16 2006
@@ -42,8 +42,7 @@
/**
- * Behavior of this method is such that when the type mapping is not found
- * it returns the default type mapping from the constant
+ * Gets the type mapping name. If type mapping is not found, returns default.
*
* @see TypeMapper#getTypeMappingName(javax.xml.namespace.QName)
*/
@@ -80,7 +79,7 @@
/**
* @param qname
- * @return object represneting a specific form of the XSD compilation
+ * @return Returns object representing a specific form of the XSD compilation.
* @see TypeMapper#getTypeMappingObject(javax.xml.namespace.QName)
*/
public Object getTypeMappingObject(QName qname) {
@@ -99,7 +98,7 @@
/**
* @see org.apache.axis2.wsdl.databinding.TypeMapper#isObjectMappingPresent()
- * @return
+ * @return Returns boolean.
*/
public boolean isObjectMappingPresent() {
return isObject;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/CodegenMessages.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/CodegenMessages.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/CodegenMessages.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/CodegenMessages.java Fri Jan 6 11:46:16 2006
@@ -1,161 +1,162 @@
-package org.apache.axis2.wsdl.i18n;
-
-import org.apache.axis2.i18n.MessageBundle;
-import org.apache.axis2.i18n.MessagesConstants;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-/*
- * Copyright 2004,2005 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.
- */
-
-/**
- * @see org.apache.axis2.i18n.Messages. The implementation is the same but just the thisClass static reference
- * has CodegenMessages.class
- */
-public class CodegenMessages {
-
- //Only this changes from the original class
- private static Class thisClass = CodegenMessages.class;
-
- private static final String projectName = MessagesConstants.projectName;
-
- private static final String resourceName = MessagesConstants.resourceName;
- private static final Locale locale = MessagesConstants.locale;
-
- private static final String packageName = getPackage(thisClass.getName());
- private static final ClassLoader classLoader = thisClass.getClassLoader();
-
- private static final ResourceBundle parent =
- (MessagesConstants.rootPackageName.equals(packageName))
- ? null
- : MessagesConstants.rootBundle;
-
-
- /**
- * ** NO NEED TO CHANGE ANYTHING BELOW ****
- */
-
- private static final MessageBundle messageBundle =
- new MessageBundle(projectName, packageName, resourceName,
- locale, classLoader, parent);
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @return The formatted message
- */
- public static String getMessage(String key)
- throws MissingResourceException {
- return messageBundle.getMessage(key);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @param arg3 The argument to place in variable {3}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2, arg3);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param arg0 The argument to place in variable {0}
- * @param arg1 The argument to place in variable {1}
- * @param arg2 The argument to place in variable {2}
- * @param arg3 The argument to place in variable {3}
- * @param arg4 The argument to place in variable {4}
- * @return The formatted message
- */
- public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3, String arg4)
- throws MissingResourceException {
- return messageBundle.getMessage(key, arg0, arg1, arg2, arg3, arg4);
- }
-
- /**
- * Get a message from resource.properties from the package of the given object.
- *
- * @param key The resource key
- * @param args An array of objects to place in corresponding variables
- * @return The formatted message
- */
- public static String getMessage(String key, String[] args)
- throws MissingResourceException {
- return messageBundle.getMessage(key, args);
- }
-
- public static ResourceBundle getResourceBundle() {
- return messageBundle.getResourceBundle();
- }
-
- public static MessageBundle getMessageBundle() {
- return messageBundle;
- }
-
- private static String getPackage(String name) {
- return name.substring(0, name.lastIndexOf('.')).intern();
- }
-
-}
+package org.apache.axis2.wsdl.i18n;
+
+import org.apache.axis2.i18n.MessageBundle;
+import org.apache.axis2.i18n.MessagesConstants;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+/*
+ * Copyright 2004,2005 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.
+ */
+
+/**
+ * @see org.apache.axis2.i18n.Messages
+ * The implementation is the same but just
+ * thisClass static reference has CodegenMessages.class
+ */
+public class CodegenMessages {
+
+ //Only this changes from the original class
+ private static Class thisClass = CodegenMessages.class;
+
+ private static final String projectName = MessagesConstants.projectName;
+
+ private static final String resourceName = MessagesConstants.resourceName;
+ private static final Locale locale = MessagesConstants.locale;
+
+ private static final String packageName = getPackage(thisClass.getName());
+ private static final ClassLoader classLoader = thisClass.getClassLoader();
+
+ private static final ResourceBundle parent =
+ (MessagesConstants.rootPackageName.equals(packageName))
+ ? null
+ : MessagesConstants.rootBundle;
+
+
+ /**
+ * ** NO NEED TO CHANGE ANYTHING BELOW ****
+ */
+
+ private static final MessageBundle messageBundle =
+ new MessageBundle(projectName, packageName, resourceName,
+ locale, classLoader, parent);
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @param arg3 The argument to place in variable {3}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2, arg3);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param arg0 The argument to place in variable {0}
+ * @param arg1 The argument to place in variable {1}
+ * @param arg2 The argument to place in variable {2}
+ * @param arg3 The argument to place in variable {3}
+ * @param arg4 The argument to place in variable {4}
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3, String arg4)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, arg0, arg1, arg2, arg3, arg4);
+ }
+
+ /**
+ * Gets a message from resource.properties from the package of the given object.
+ *
+ * @param key The resource key
+ * @param args An array of objects to place in corresponding variables
+ * @return Returns the formatted message.
+ */
+ public static String getMessage(String key, String[] args)
+ throws MissingResourceException {
+ return messageBundle.getMessage(key, args);
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return messageBundle.getResourceBundle();
+ }
+
+ public static MessageBundle getMessageBundle() {
+ return messageBundle;
+ }
+
+ private static String getPackage(String name) {
+ return name.substring(0, name.lastIndexOf('.')).intern();
+ }
+
+}
Modified: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/ProjectResourceBundle.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/ProjectResourceBundle.java?rev=366555&r1=366554&r2=366555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/ProjectResourceBundle.java (original)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/ProjectResourceBundle.java Fri Jan 6 11:46:16 2006
@@ -135,8 +135,8 @@
*
* @param projectName The name of the project to which the class belongs.
* It must be a proper prefix of the caller's package.
- * @param packageName The package name to further construct
- * the basename.
+ * @param caller The calling class.
+ *
* @param resourceName The name of the resource without the
* ".properties" extension
* @throws MissingResourceException if projectName is not a prefix of
@@ -160,9 +160,8 @@
*
* @param projectName The name of the project to which the class belongs.
* It must be a proper prefix of the caller's package.
- * @param caller The calling class.
- * This is used to get the package name to further construct
- * the basename as well as to get the proper ClassLoader.
+ * @param packageName The package name to construct base name.
+ *
* @param resourceName The name of the resource without the
* ".properties" extension
* @param locale The locale