[jbossws-commits] JBossWS SVN: r16844 - in stack/native/trunk/modules/core/src/main/java/org/jboss/ws: metadata/wsdl and 2 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Thu Oct 11 04:18:16 EDT 2012
Author: alessio.soldano at jboss.com
Date: 2012-10-11 04:18:16 -0400 (Thu, 11 Oct 2012)
New Revision: 16844
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/Message.properties
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java
Log:
[JBWS-3509] WIP on convertin native messages to new logging...
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -110,4 +110,20 @@
@Message(id = 25063, value = "WSDL parsing, unprocessed extension element: %s")
void unprocessedWSDLExtensionElement(QName el);
+ @LogMessage(level = WARN)
+ @Message(id = 25084, value = "Multiple WSDL bindings reference the same interface: %s")
+ void multipleWSDLBindingRefs(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25085, value = "Multiple binding operations reference: %s")
+ void multipleBindingOperationRefs(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25086, value = "Cannot obtain binding operation for ref: %s")
+ void cannotObtainBindingOperationForRef(QName qname);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25097, value = "Cannot parse XSModel string: %s")
+ void cannotParseXSModelString(String s, @Cause Throwable cause);
+
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -30,10 +30,13 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xs.XSElementDeclaration;
import org.jboss.logging.Cause;
import org.jboss.logging.Message;
import org.jboss.logging.MessageBundle;
import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.wsf.spi.deployment.Deployment;
/**
@@ -202,4 +205,88 @@
@Message(id = 25067, value = "Unsupported WSDL version: %s")
WSException unsupportedWSDLVersion(String version);
+ @Message(id = 25068, value = "Cannot obtain XSTypeDefinition for: %s")
+ WSException cannotObtainXSTypeDef(QName q);
+
+ @Message(id = 25069, value = "Illegal null argument: %s")
+ IllegalArgumentException illegalNullArgument(Object argument);
+
+ @Message(id = 25070, value = "String passed is null")
+ WSException stringPassedIsNull();
+
+ @Message(id = 25071, value = "Illegal null or array arg: %s")
+ IllegalArgumentException illegalNullOrArrayArgument(Class<?> clazz);
+
+ @Message(id = 25072, value = "QName passed is null")
+ IllegalArgumentException qNamePassedIsNull();
+
+ @Message(id = 25073, value = "Formatted String is not of format prefix:localpart: %s")
+ IllegalArgumentException formattedStringNotInFormatPrefixLocalPart(String s);
+
+ @Message(id = 25074, value = "WSDLTypes is not an XSModelTypes: %s")
+ WSException wsdlTypesNotAnXSModelTypes(WSDLTypes wt);
+
+ @Message(id = 25075, value = "Only Request-Only and Request-Response MEPs are allowed, WSDLInterfaceOperation = %s")
+ WSException reqOnlyAndReqResMEPsOnlySupported(QName opName);
+
+ @Message(id = 25076, value = "Illegal property URI: %s")
+ IllegalArgumentException illegalPropertyURI(String uri);
+
+ @Message(id = 25077, value = "Attempt to map multiple operation inputs to: %s")
+ WSException attempToMapMultipleInputs(QName q);
+
+ @Message(id = 25078, value = "Attempt to map multiple operation outputs to: %s")
+ WSException attempToMapMultipleOutputs(QName q);
+
+ @Message(id = 25079, value = "Cannot obtain xmlType for element: %s")
+ WSException cannotObtainXmlType(QName q);
+
+ @Message(id = 25080, value = "Illegal feature URI: %s")
+ IllegalArgumentException illegalFeatureURI(String uri);
+
+ @Message(id = 25081, value = "Cannot obtain the binding: %s")
+ WSException cannotObtainBinding(QName q);
+
+ @Message(id = 25082, value = "Cannot obtain the interface associated with this endpoint: %s")
+ WSException cannotObtainInterface(QName q);
+
+ @Message(id = 25083, value = "The prefix %s cannot be bound to any namespace other than its usual namespace, trying to bind to %s")
+ IllegalArgumentException prefixCannotBeBoundTryingBindingTo(String prefix, String to);
+
+ @Message(id = 25087, value = "Cannot get interface for name: %s")
+ WSException cannotGetInterfaceForName(QName q);
+
+ @Message(id = 25088, value = "Empty union type not expected")
+ WSException emptyUnionTypeNotExpected();
+
+ @Message(id = 25089, value = "Absent variety is not supported in simple types")
+ WSException absentVariety();
+
+ @Message(id = 25090, value = "Expected base type to be a simple type")
+ WSException baseTypeNotSimple();
+
+ @Message(id = 25091, value = "xmlName has a null %s")
+ IllegalArgumentException xmlNameHasNull(String prop);
+
+ @Message(id = 25092, value = "Cannot parse schema: %s")
+ WSException cannotParseSchema(String location);
+
+ @Message(id = 25093, value = "Target Namespace of xsmodel is null")
+ WSException nullTargetNsXSModel();
+
+ @Message(id = 25094, value = "%s is not a global element")
+ IllegalArgumentException notAGlobalElement(XSElementDeclaration el);
+
+ @Message(id = 25095, value = "Type unidentified")
+ WSException typeUnidentified();
+
+ @Message(id = 25096, value = "objectType should be simple type or complex type")
+ IllegalArgumentException objectTypeShouldBeSimpleOrComplex();
+
+ @Message(id = 25098, value = "Parser should stop: %s")
+ XNIException parserShouldStop(String traceMex, @Cause Exception cause);
+
+ @Message(id = 25099, value = "Parser should stop, the key value is %s")
+ XNIException parserShouldStopKeyValueIs(String keyValue, @Cause Exception cause);
+
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Extendable.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -43,8 +43,8 @@
// provide logging
private Logger log = Logger.getLogger(getClass());
- private Map features = new LinkedHashMap();
- private Map properties = new LinkedHashMap();
+ private Map<String, WSDLFeature> features = new LinkedHashMap<String, WSDLFeature>();
+ private Map<String, WSDLProperty> properties = new LinkedHashMap<String, WSDLProperty>();
private Map<String,List<WSDLExtensibilityElement>> extElements = new LinkedHashMap<String,List<WSDLExtensibilityElement>>();
private List<WSDLExtensibilityElement> notUnderstoodExtElements = new LinkedList<WSDLExtensibilityElement>();
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Message.properties 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/Message.properties 2012-10-11 08:18:16 UTC (rev 16844)
@@ -1,29 +0,0 @@
-CANNOT_GET_INTERFACE=Cannot get interface for name: {0}
-MULTIPLE_BINDING_OP_REFERENCE=Multiple binding operations reference: {0}
-CANNOT_OBTAIN_BINDING_OPERATION=Cannot obtain binding operation for ref: {0}
-
-ILLEGAL_PROPERTY_URI=Illegal property URI: {0}
-
-CANNOT_OBTAIN_XSTYPEDEF=Cannot obtain XSTypeDefinition for: {0}
-CANNOT_OBTAIN_XMLTYPE=Cannot obtain xmlType for element: {0}
-
-MAP_MULTIPLE_INPUTS=Attempt to map multiple operation inputs to: {0}
-MAP_MULTIPLE_OUTPUTS=Attempt to map multiple operation outputs to: {0}
-
-CAN_NOT_BE_BPOUND=The prefix {0} cannot be bound to any namespace other than its usual namespace,trying to bind to {1}
-ILLEGAL_NULL_ARGUMENT:NAMESPACEURI=Illegal Null Argument:namespaceURI
-INVALID_DEFAULT_NAMESPACE=Invalid default namespace: {0}
-MULTIPLE_BINDINGS_REF=Multiple WSDL bindings referrence the same interface: {0}
-
-CANNOT_OBTAIN_BINDING=Cannot obtain the binding: {0}
-CANNOT_OBTAIN_INTF=Cannot obtain the interface associated with this endpoint: {0}
-
-ILLEGAL_FEATURE_URI=Illegal feature URI: {0}
-ILLEGAL_NULL_ARGUMENT=Illegal null argument:{0}
-STRING_PASSED_IS_NULL=String passed is null
-ILLEGAL_NULL_OR_ARRAY_ARG=Illegal null or array arg: {0}
-STRING_PASSED_IS_NULL=String passed to WSDLUtils.getMixedCase is null
-QNAME_PASSED_IS_NULL= QName passed is null
-INVALID_FORMATTED_STRING=Formatted String is not of format prefix:localpart
-NOT_AN_XSMODELTYPES=WSDLTypes is not an XSModelTypes
-ONLY_MEPS_ARE_ALLOWED=Only Request-Only and Request-Response MEPs are allowed
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBinding.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -23,13 +23,11 @@
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
/**
* A Binding component describes a concrete message format and transmission protocol which may be used
@@ -42,12 +40,8 @@
*/
public class WSDLBinding extends Extendable implements Serializable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLBinding.class);
private static final long serialVersionUID = -7699953670233209811L;
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLBinding.class);
-
// The parent WSDL definitions element.
private final WSDLDefinitions wsdlDefinitions;
@@ -91,7 +85,6 @@
public void setInterfaceName(QName interfaceName)
{
- log.trace("setInterfaceName: " + name);
this.interfaceName = interfaceName;
}
@@ -99,7 +92,7 @@
{
WSDLInterface wsdlInterface = wsdlDefinitions.getInterface(interfaceName);
if (wsdlInterface == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_GET_INTERFACE", interfaceName));
+ throw NativeMessages.MESSAGES.cannotGetInterfaceForName(interfaceName);
return wsdlInterface;
}
@@ -140,13 +133,13 @@
if (aux.getRef().equals(qname))
{
if (wsdlBindingOperation != null)
- log.warn(BundleUtils.getMessage(bundle, "MULTIPLE_BINDING_OP_REFERENCE", qname));
+ NativeLoggers.ROOT_LOGGER.multipleBindingOperationRefs(qname);
wsdlBindingOperation = aux;
}
}
if (wsdlBindingOperation == null)
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_BINDING_OPERATION", qname));
+ NativeLoggers.ROOT_LOGGER.cannotObtainBindingOperationForRef(qname);
return wsdlBindingOperation;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,19 +21,20 @@
*/
package org.jboss.ws.metadata.wsdl;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.Constants;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Document;
@@ -49,7 +50,6 @@
*/
public class WSDLDefinitions extends Extendable implements Serializable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLDefinitions.class);
private static final long serialVersionUID = 1643422922694990226L;
// provide logging
@@ -123,8 +123,7 @@
}
else if (Constants.PREFIX_XML.equalsIgnoreCase(prefix))
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CAN_NOT_BE_BPOUND",
- new Object[]{Constants.PREFIX_XML, nsURI}));
+ throw MESSAGES.prefixCannotBeBoundTryingBindingTo(Constants.PREFIX_XML, nsURI);
}
String pre = namespaces.getPrefix(nsURI);
@@ -161,13 +160,13 @@
}
/** Get an iterator for registered namespace URIs */
- public Iterator getRegisteredNamespaceURIs()
+ public Iterator<String> getRegisteredNamespaceURIs()
{
return namespaces.getRegisteredURIs();
}
/** Get an iterator for registered prefixs */
- public Iterator getRegisteredPrefix()
+ public Iterator<String> getRegisteredPrefix()
{
return namespaces.getRegisteredPrefixes();
}
@@ -180,7 +179,7 @@
public void setTargetNamespace(String namespaceURI)
{
if(namespaceURI == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "namespaceURI"));
+ throw MESSAGES.illegalNullArgument("namespaceURI");
log.trace("setTargetNamespace: " + namespaceURI);
this.targetNamespace = namespaceURI;
@@ -194,7 +193,7 @@
public void setWsdlNamespace(String namespaceURI)
{
if (Constants.NS_WSDL11.equals(namespaceURI) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DEFAULT_NAMESPACE", namespaceURI));
+ throw MESSAGES.invalidDefaultWSDLNamespace(namespaceURI);
this.wsdlNamespace = namespaceURI;
}
@@ -271,7 +270,7 @@
if (aux.getInterfaceName().equals(qname))
{
if (wsdlBinding != null)
- log.warn(BundleUtils.getMessage(bundle, "MULTIPLE_BINDINGS_REF", qname));
+ NativeLoggers.ROOT_LOGGER.multipleWSDLBindingRefs(qname);
wsdlBinding = aux;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLEndpoint.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,13 +21,10 @@
*/
package org.jboss.ws.metadata.wsdl;
-import java.util.ResourceBundle;
-
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* An Endpoint component defines the particulars of a specific endpoint at which a given service is available.
@@ -39,7 +36,6 @@
*/
public class WSDLEndpoint extends Extendable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLEndpoint.class);
private static final long serialVersionUID = 4991302339046047865L;
// provide logging
@@ -85,7 +81,7 @@
{
WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(binding);
if (wsdlBinding == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_BINDING", binding));
+ throw NativeMessages.MESSAGES.cannotObtainBinding(binding);
if (wsdlBinding.getInterfaceName() != null)
{
@@ -95,7 +91,7 @@
}
if (wsdlInterface == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_INTF", name));
+ throw NativeMessages.MESSAGES.cannotObtainInterface(name);
return wsdlInterface;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLFeature.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -22,9 +22,8 @@
package org.jboss.ws.metadata.wsdl;
import java.io.Serializable;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* A feature component describes an abstract piece of functionality typically associated with the exchange of
@@ -39,7 +38,6 @@
*/
public class WSDLFeature implements Serializable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLFeature.class);
private static final long serialVersionUID = 8096857958254222743L;
/** A REQUIRED uri attribute information item */
@@ -50,7 +48,7 @@
public WSDLFeature(String uri)
{
if (uri == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_FEATURE_URI", uri));
+ throw NativeMessages.MESSAGES.illegalFeatureURI(uri);
this.uri = uri;
}
@@ -58,7 +56,7 @@
public WSDLFeature(String uri, boolean required)
{
if (uri == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_FEATURE_URI", uri));
+ throw NativeMessages.MESSAGES.illegalFeatureURI(uri);
this.uri = uri;
this.required = required;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceMessageReference.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -23,13 +23,11 @@
import java.util.Collection;
import java.util.LinkedHashMap;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
/**
@@ -43,7 +41,6 @@
*/
public abstract class WSDLInterfaceMessageReference extends Extendable implements Comparable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLInterfaceMessageReference.class);
// provide logging
protected Logger log = Logger.getLogger(getClass());
@@ -87,7 +84,8 @@
public WSDLInterfaceMessageReference(WSDLInterfaceOperation wsdlOperation)
{
- log.trace("New part for wsdlOperation: " + wsdlOperation.getName());
+ if (log.isTraceEnabled())
+ log.trace("New part for wsdlOperation: " + wsdlOperation.getName());
this.wsdlOperation = wsdlOperation;
}
@@ -113,7 +111,8 @@
public void setElement(QName element)
{
- log.trace("setElement: " + element);
+ if (log.isTraceEnabled())
+ log.trace("setElement: " + element);
this.element = element;
}
@@ -145,7 +144,7 @@
}
if (xmlType == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_XMLTYPE", element));
+ throw NativeMessages.MESSAGES.cannotObtainXmlType(element);
return xmlType;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperation.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -25,12 +25,10 @@
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.metadata.wsdl.WSDLRPCSignatureItem.Direction;
@@ -47,7 +45,6 @@
*/
public class WSDLInterfaceOperation extends Extendable implements Comparable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLInterfaceOperation.class);
private static final long serialVersionUID = -5014918078197942626L;
// The parent interface
@@ -145,7 +142,7 @@
{
QName xmlName = input.getElement();
if (inputs.get(xmlName) != null)
- throw new WSException(BundleUtils.getMessage(bundle, "MAP_MULTIPLE_INPUTS", xmlName));
+ throw NativeMessages.MESSAGES.attempToMapMultipleInputs(xmlName);
inputs.put(xmlName, input);
}
@@ -183,7 +180,7 @@
{
QName xmlName = output.getElement();
if (outputs.get(xmlName) != null)
- throw new WSException(BundleUtils.getMessage(bundle, "MAP_MULTIPLE_OUTPUTS", xmlName));
+ throw NativeMessages.MESSAGES.attempToMapMultipleOutputs(xmlName);
outputs.put(xmlName, output);
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLProperty.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -22,11 +22,10 @@
package org.jboss.ws.metadata.wsdl;
import java.io.Serializable;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* A "property" in the Features and Properties architecture represents a named runtime value which affects
@@ -42,7 +41,6 @@
*/
public class WSDLProperty implements Serializable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLProperty.class);
private static final long serialVersionUID = -7528676719881753461L;
/** A REQUIRED uri attribute information item */
@@ -56,30 +54,19 @@
* #value if the {value} property is not empty.*/
private QName constraint;
- private QName qnameValue;
-
public WSDLProperty(String uri, String value)
{
if (uri == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_PROPERTY_URI", uri));
+ throw NativeMessages.MESSAGES.illegalPropertyURI(uri);
this.uri = uri;
this.value = value;
}
- public WSDLProperty(String uri, QName value)
- {
- if (uri == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_PROPERTY_URI", uri));
-
- this.uri = uri;
- this.qnameValue = value;
- }
-
public WSDLProperty(String uri, boolean required, String value, QName constraint)
{
if (uri == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_PROPERTY_URI", uri));
+ throw NativeMessages.MESSAGES.illegalPropertyURI(uri);
this.uri = uri;
this.required = required;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLService.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -26,8 +26,6 @@
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-
/**
* A Service component describes a set of endpoints (see 2.14 Endpoint [p.62] ) at which a particular
* deployed implementation of the service is provided. The endpoints thus are in effect alternate places at
@@ -41,9 +39,6 @@
{
private static final long serialVersionUID = 1274166611190648479L;
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLService.class);
-
// The parent WSDL definitions element.
private final WSDLDefinitions wsdlDefinitions;
@@ -97,7 +92,7 @@
*/
public WSDLEndpoint getEndpoint(QName portName)
{
- Iterator it = endpoints.iterator();
+ Iterator<WSDLEndpoint> it = endpoints.iterator();
while (it.hasNext())
{
WSDLEndpoint wsdlEndpoint = (WSDLEndpoint)it.next();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -25,8 +25,6 @@
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-
/**
* WSDL types.
*
@@ -38,9 +36,6 @@
{
private static final long serialVersionUID = 7919937323521372194L;
- // provide logging
- static private final Logger log = Logger.getLogger(WSDLTypes.class);
-
private WSDLDefinitions wsdlDefinitions;
private String namespace;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.metadata.wsdl;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
@@ -35,7 +37,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Stack;
import java.util.StringTokenizer;
@@ -67,7 +68,6 @@
import org.apache.xerces.xs.XSComplexTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
@@ -84,18 +84,17 @@
public class WSDLUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLUtils.class);
private String newline = "\n";
private static WSDLUtils instance = new WSDLUtils();
- private List wrapperlist = null;
- private List primlist = null;
+ private List<String> wrapperlist = null;
+ private List<String> primlist = null;
- private final Map primitiveMap = new HashMap();
+ private final Map<String, String> primitiveMap = new HashMap<String, String>();
- private final static Map<String, Class> schemaBasicTypes = new HashMap<String, Class>();
- private final static Map<Class, Class> holderTypes = new HashMap<Class, Class>();
- private final static Map<Class, Class> reverseHolderTypes = new HashMap<Class, Class>();
+ private final static Map<String, Class<?>> schemaBasicTypes = new HashMap<String, Class<?>>();
+ private final static Map<Class<?>, Class<?>> holderTypes = new HashMap<Class<?>, Class<?>>();
+ private final static Map<Class<?>, Class<?>> reverseHolderTypes = new HashMap<Class<?>, Class<?>>();
// Skip these methods when generating wsdl operations
private List<String> ignoredMethods;
@@ -236,10 +235,10 @@
* @param cls
* @return true if class belongs to java.* or javax.* package
*/
- public boolean checkIgnoreClass(Class cls)
+ public boolean checkIgnoreClass(Class<?> cls)
{
if (cls == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "cls"));
+ throw MESSAGES.illegalNullArgument("cls");
//if (cls.isArray()) cls = cls.getComponentType();
if (!cls.isArray())
{
@@ -308,9 +307,9 @@
public File createPackage(String path, String packageName)
{
if (packageName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "packageName"));
+ throw MESSAGES.illegalNullArgument("packageName");
if (path == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "path"));
+ throw MESSAGES.illegalNullArgument("path");
String pac = packageName.replace('.', '/');
File dir = new File(path + "/" + pac);
dir.mkdirs();
@@ -327,9 +326,9 @@
public File createPhysicalFile(File loc, String fname) throws IOException
{
if (loc == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "loc"));
+ throw MESSAGES.illegalNullArgument("loc");
if (fname == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "fname"));
+ throw MESSAGES.illegalNullArgument("fname");
File javaFile = new File(loc.getAbsolutePath() + "/" + fname + ".java");
//Delete the javaFile if already exists
if (javaFile.exists())
@@ -348,7 +347,7 @@
* @param importList Strings representing imports
* @return
*/
- public StringBuilder createClassBasicStructure(String pkgname, String fname, XSTypeDefinition type, List importList, String baseName)
+ public StringBuilder createClassBasicStructure(String pkgname, String fname, XSTypeDefinition type, List<?> importList, String baseName)
{
StringBuilder buf = new StringBuilder();
writeJbossHeader(buf);
@@ -358,7 +357,7 @@
buf.append(newline);
if (importList != null)
{
- Iterator iter = importList.iterator();
+ Iterator<?> iter = importList.iterator();
while (iter.hasNext())
{
buf.append("import " + (String)iter.next() + ";");
@@ -402,7 +401,7 @@
* @param name Field name to check
* @return true - if public field exists, false-otherwise
*/
- public boolean doesPublicFieldExist(Class javaType, String name)
+ public boolean doesPublicFieldExist(Class<?> javaType, String name)
{
Field fld = null;
try
@@ -431,7 +430,7 @@
public String firstLetterUpperCase(String fname)
{
if (fname == null || fname.length() == 0)
- throw new WSException(BundleUtils.getMessage(bundle, "STRING_PASSED_IS_NULL"));
+ throw MESSAGES.stringPassedIsNull();
//Ensure that the first character is uppercase
final char firstChar = fname.charAt(0);
if (Character.isLowerCase(firstChar))
@@ -448,10 +447,10 @@
* @param arr
* @return dimension of an array
*/
- public int getArrayDimension(Class arr)
+ public int getArrayDimension(Class<?> arr)
{
if (arr == null || arr.isArray() == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_OR_ARRAY_ARG", arr));
+ throw MESSAGES.illegalNullOrArrayArgument(arr);
int counter = 0;
while (arr.isArray())
{
@@ -467,7 +466,7 @@
* @param cls
* @return Jaxrpc Holder object if exists
*/
- public Class getHolder(Class cls)
+ public Class<?> getHolder(Class<?> cls)
{
return holderTypes.get(cls);
}
@@ -478,7 +477,7 @@
* @param cls The jaxrpc holder type
* @return Jaxrpc Holder object if exists
*/
- public Class getJavaTypeForHolder(Class cls)
+ public Class<?> getJavaTypeForHolder(Class<?> cls)
{
if (Holder.class.isAssignableFrom(cls))
return HolderUtils.getValueType(cls);
@@ -493,7 +492,7 @@
* @return
*/
- public String getMessagePartForArray(Class javaType)
+ public String getMessagePartForArray(Class<?> javaType)
{
StringBuilder sb = new StringBuilder();
while (javaType.isArray())
@@ -513,13 +512,13 @@
* @return just the classname
*/
- public static String getJustClassName(Class cls)
+ public static String getJustClassName(Class<?> cls)
{
if (cls == null)
return null;
if (cls.isArray())
{
- Class c = cls.getComponentType();
+ Class<?> c = cls.getComponentType();
return getJustClassName(c.getName());
}
@@ -545,9 +544,9 @@
* From the list of fields defined by this class (not superclasses)
* get the fields that are relevant (public)
*/
- public Field[] getPublicFields(Class cls)
+ public Field[] getPublicFields(Class<?> cls)
{
- ArrayList list = new ArrayList();
+ ArrayList<Field> list = new ArrayList<Field>();
Field[] fld = cls.getDeclaredFields();
for (int i = 0; i < fld.length; i++)
@@ -573,7 +572,7 @@
*/
public Method[] getPublicProtectedMethods(Method[] methods)
{
- ArrayList list = new ArrayList();
+ ArrayList<Method> list = new ArrayList<Method>();
int len = methods.length;
for (int i = 0; i < len; i++)
@@ -596,12 +595,12 @@
* @param xmlType
* @return
*/
- public Class getJavaType(QName xmlType)
+ public Class<?> getJavaType(QName xmlType)
{
if (xmlType == null)
return null;
String localPart = xmlType.getLocalPart();
- return (Class)schemaBasicTypes.get(localPart);
+ return schemaBasicTypes.get(localPart);
}
/**
@@ -612,7 +611,7 @@
public String getMixedCase(String str)
{
if (str == null || str.length() == 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "STRING_PASSED_IS_NULL"));
+ throw MESSAGES.stringPassedIsNull();
if (str.length() == 1)
return str.toUpperCase();
@@ -629,7 +628,7 @@
public String getFormattedString(QName qn)
{
if (qn == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "QNAME_PASSED_IS_NULL"));
+ throw MESSAGES.qNamePassedIsNull();
StringBuilder sb = new StringBuilder();
String prefix = qn.getPrefix();
String localpart = qn.getLocalPart();
@@ -651,7 +650,7 @@
QName qn = null;
int ind = formattedStr.lastIndexOf(':');
if (ind < 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_FORMATTED_STRING"));
+ throw MESSAGES.formattedStringNotInFormatPrefixLocalPart(formattedStr);
String prefix = formattedStr.substring(0, ind);
String nsuri = null;
if (Constants.PREFIX_XSD.equals(prefix))
@@ -683,7 +682,7 @@
return pkgname;
}
- public static String getTypeNamespace(Class javaType)
+ public static String getTypeNamespace(Class<?> javaType)
{
return getTypeNamespace(JavaUtils.getPackageName(javaType));
}
@@ -741,13 +740,13 @@
if (types instanceof XSModelTypes)
return ((XSModelTypes)types).getSchemaModel();
- throw new WSException(BundleUtils.getMessage(bundle, "NOT_AN_XSMODELTYPES"));
+ throw MESSAGES.wsdlTypesNotAnXSModelTypes(types);
}
public static void addSchemaModel(WSDLTypes types, String namespace, JBossXSModel model)
{
if (!(types instanceof XSModelTypes))
- throw new WSException(BundleUtils.getMessage(bundle, "NOT_AN_XSMODELTYPESs"));
+ throw MESSAGES.wsdlTypesNotAnXSModelTypes(types);
XSModelTypes modelTypes = (XSModelTypes)types;
modelTypes.addSchemaModel(namespace, model);
@@ -759,7 +758,7 @@
* @param cls a Class object
* @return true: A Standard jaxrpc holder
*/
- public boolean isStandardHolder(Class cls)
+ public boolean isStandardHolder(Class<?> cls)
{
if (Holder.class.isAssignableFrom(cls) == false)
return false; //Not even a holder
@@ -846,7 +845,7 @@
return outputs[0];
}
- throw new WSException(BundleUtils.getMessage(bundle, "ONLY_MEPS_ARE_ALLOWED"));
+ throw MESSAGES.reqOnlyAndReqResMEPsOnlySupported(operation.getName());
}
public static WSDLInterfaceOperationInput getWsdl11Input(WSDLInterfaceOperation operation)
@@ -863,6 +862,6 @@
return inputs[0];
}
- throw new WSException(BundleUtils.getMessage(bundle, "ONLY_MEPS_ARE_ALLOWED"));
+ throw MESSAGES.reqOnlyAndReqResMEPsOnlySupported(operation.getName());
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/XSModelTypes.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,15 +21,11 @@
*/
package org.jboss.ws.metadata.wsdl;
-import java.util.ResourceBundle;
-
import javax.xml.namespace.QName;
import org.apache.xerces.xs.XSElementDeclaration;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
/**
@@ -39,9 +35,6 @@
*/
public class XSModelTypes extends WSDLTypes
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(XSModelTypes.class);
- private static final Logger log = Logger.getLogger(XSModelTypes.class);
-
private JBossXSModel schemaModel;
public XSModelTypes()
@@ -62,7 +55,6 @@
{
if(nsURI == null)
{
- log.trace("nsURI passed to addSchemaModel is null. Replacing Schema Model");
schemaModel = schema;
}
else
@@ -90,7 +82,7 @@
{
XSTypeDefinition xstype = xsel.getTypeDefinition();
if (xstype == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_XSTYPEDEF", xmlName));
+ throw NativeMessages.MESSAGES.cannotObtainXSTypeDef(xmlName);
if (xstype.getAnonymous() == false)
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSComplexTypeDefinition.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -46,8 +46,6 @@
private XSParticle xspart;
private XSObjectList annots;
- private String prefix;
-
private List<XSAttributeUse> attList = new ArrayList<XSAttributeUse>();
//Content Type
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,8 +21,6 @@
*/
package org.jboss.ws.metadata.wsdl.xmlschema;
-import java.util.ResourceBundle;
-
import org.apache.xerces.xs.ShortList;
import org.apache.xerces.xs.XSAnnotation;
import org.apache.xerces.xs.XSComplexTypeDefinition;
@@ -32,7 +30,7 @@
import org.apache.xerces.xs.XSNamedMap;
import org.apache.xerces.xs.XSObjectList;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* Represents an XS Element Declaration
@@ -41,7 +39,6 @@
*/
public class JBossXSElementDeclaration extends JBossXSObject implements XSElementDeclaration
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossXSElementDeclaration.class);
protected String targetNamespace = null;
protected JBossXSTypeDefinition xstype = null;
protected boolean nillable = false;
@@ -77,7 +74,7 @@
public JBossXSElementDeclaration(XSElementDeclaration xe)
{
if (xe == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT","xe"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xe");
xsed = xe;
name = xe.getName();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -68,7 +68,9 @@
*/
public XMLInputSource resolveEntity(XMLResourceIdentifier resId) throws XNIException, IOException
{
- log.trace("Resolve entity: " + resId);
+ final boolean trace = log.isTraceEnabled();
+ if (trace)
+ log.trace("Resolve entity: " + resId);
// First try the JBossEntityResolver
String publicId = resId.getPublicId();
@@ -86,7 +88,8 @@
}
catch (Exception ex)
{
- log.trace(ex);
+ if (trace)
+ log.trace(ex);
}
try
@@ -94,26 +97,30 @@
String expandedSysId = resId.getExpandedSystemId();
if (expandedSysId != null)
{
- log.trace("Use ExpandedSystemId: " + expandedSysId);
+ if (trace)
+ log.trace("Use ExpandedSystemId: " + expandedSysId);
return getXMLInputSource(new URL(expandedSysId), resId);
}
}
catch (IOException e)
{
- log.trace(e);
+ if (trace)
+ log.trace(e);
}
try
{
if (systemId != null)
{
- log.trace("Use LiteralSystemId: " + systemId);
+ if (trace)
+ log.trace("Use LiteralSystemId: " + systemId);
return getXMLInputSource(new URL(systemId), resId);
}
}
catch (IOException e)
{
- log.trace(e);
+ if (trace)
+ log.trace(e);
}
// in case of a DOCTYPE declaration ew refer to systemId
@@ -128,7 +135,8 @@
URL url = schemaLocationByNamespace.get(namespaceURI);
if (url != null)
{
- log.trace("Use SchemaLocationByNamespace: " + url);
+ if (trace)
+ log.trace("Use SchemaLocationByNamespace: " + url);
return getXMLInputSource(url, resId);
}
@@ -139,20 +147,24 @@
}
catch (SAXException e)
{
- log.trace(e);
+ if (trace)
+ log.trace(e);
}
try
{
- log.trace("Use NamespaceURI: " + namespaceURI);
+ if (trace)
+ log.trace("Use NamespaceURI: " + namespaceURI);
return getXMLInputSource(new URL(namespaceURI), resId);
}
catch (IOException e)
{
- log.trace(e);
+ if (trace)
+ log.trace(e);
}
- log.trace("Cannot obtain XMLInputSource for: " + resId);
+ if (trace)
+ log.trace("Cannot obtain XMLInputSource for: " + resId);
return null;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSErrorHandler.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,13 +21,11 @@
*/
package org.jboss.ws.metadata.wsdl.xmlschema;
-import java.util.ResourceBundle;
-
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLErrorHandler;
import org.apache.xerces.xni.parser.XMLParseException;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* Error Handler for the Xerces schema parser default implementation
@@ -36,7 +34,6 @@
*/
public class JBossXSErrorHandler implements XMLErrorHandler
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossXSErrorHandler.class);
private static final Logger log = Logger.getLogger(JBossXSErrorHandler.class);
/**
@@ -61,7 +58,7 @@
public void error(String domain, String key, XMLParseException xexp) throws XNIException
{
if ("src-include.2.1".equals(key))
- throw new XNIException(BundleUtils.getMessage(bundle, "PARSER_SHOULD_STOP", "the key value is src-include.2.1"), xexp);
+ throw NativeMessages.MESSAGES.parserShouldStopKeyValueIs("src-include.2.1", xexp);
String errorMsg = getFormattedString(domain, key, xexp);
log.error(errorMsg);
@@ -79,7 +76,7 @@
{
String errorMsg = getFormattedString(domain, key, xexp);
log.error(errorMsg);
- throw new XNIException(BundleUtils.getMessage(bundle, "PARSER_SHOULD_STOP", errorMsg), xexp);
+ throw NativeMessages.MESSAGES.parserShouldStop(errorMsg, xexp);
}
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -32,7 +32,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import org.apache.xerces.xs.StringList;
@@ -55,8 +54,8 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
@@ -72,10 +71,8 @@
public class JBossXSModel implements XSModel, Cloneable
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossXSModel.class);
// provide logging
private static final Logger log = Logger.getLogger(JBossXSModel.class);
-
private AnonymousMapper anonymousMapper = new AnonymousMapper();
private boolean qualifiedElements = false;
@@ -315,7 +312,7 @@
}
else
{
- log.trace("Cannot assign XSAnnotation to null namespace");
+ Logger.getLogger(JBossXSModel.class).trace("Cannot assign XSAnnotation to null namespace");
}
}
@@ -331,8 +328,6 @@
{
//Add type to the namespace item
String ns = xst.getNamespace();
- if (ns == null)
- throw new WSException(BundleUtils.getMessage(bundle, "ILLEGAL_NAMESPACE"));
JBossXSNamespaceItem jbnm = createNamespaceItemIfNotExistent(ns);
jbnm.addXSTypeDefinition(xst);
@@ -453,7 +448,7 @@
}
catch (IOException e)
{
- log.error(BundleUtils.getMessage(bundle, "CANNOT_PARSE_XSMODEL", xsModelString), e);
+ NativeLoggers.ROOT_LOGGER.cannotParseXSModelString(xsModelString, e);
}
}
@@ -510,7 +505,7 @@
private JBossXSNamespaceItem createNamespaceItemIfNotExistent(String ns)
{
if (ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "ns"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("ns");
JBossXSNamespaceItem jbnm = nsimap.get(ns);
if (jbnm == null)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -28,7 +28,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.TreeSet;
import org.apache.xerces.xs.StringList;
@@ -45,8 +44,7 @@
import org.apache.xerces.xs.XSObjectList;
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -57,10 +55,6 @@
*/
public class JBossXSNamespaceItem implements XSNamespaceItem
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossXSNamespaceItem.class);
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXSNamespaceItem.class);
-
private String schemaNamespace = null;
private List<String> docLocations = null;
@@ -258,7 +252,7 @@
public void addXSAnnotation(XSAnnotation xa)
{
if(xa == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xa"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xa");
anns.put(xa.getName(),xa);
}
@@ -268,7 +262,7 @@
public void addXSAttributeDeclaration(XSAttributeDeclaration att)
{
if(att == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "att"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("att");
attrs.put(att.getName(),att);
}
@@ -279,7 +273,7 @@
public void addXSElementDeclaration(XSElementDeclaration el)
{
if(el == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "el"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("el");
elements.put(el.getName(),el);
}
@@ -290,10 +284,9 @@
public void addXSTypeDefinition(XSTypeDefinition xsType)
{
if(xsType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsType"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xsType");
String xsTypeName = xsType.getName();
- log.trace("addXSTypeDefinition: " + xsTypeName);
types.put(xsTypeName,xsType);
}
@@ -458,7 +451,7 @@
private Collection getTypes(Collection col, short objectType)
{
if(objectType != XSTypeDefinition.SIMPLE_TYPE && objectType != XSTypeDefinition.COMPLEX_TYPE)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "OBJECTTYPE_SHOULD_BE_SIMPLE_TYPE_OR_COMPLEX_TYPE"));
+ throw NativeMessages.MESSAGES.objectTypeShouldBeSimpleOrComplex();
Collection values = new ArrayList();
for(Object obj : col)
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSTypeDefinition.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,11 +21,8 @@
*/
package org.jboss.ws.metadata.wsdl.xmlschema;
-import java.util.ResourceBundle;
-
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* @author <mailto:Anil.Saldhana at jboss.org>Anil Saldhana
@@ -33,7 +30,6 @@
*/
public class JBossXSTypeDefinition extends JBossXSObject implements XSTypeDefinition
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossXSTypeDefinition.class);
private static final long serialVersionUID = -3317350531846406564L;
protected boolean anonymous = false;
@@ -74,7 +70,7 @@
*/
public short getTypeCategory()
{
- throw new WSException(BundleUtils.getMessage(bundle, "TYPE_UNIDENTIFIED"));
+ throw NativeMessages.MESSAGES.typeUnidentified();
}
/**
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/Message.properties 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/Message.properties 2012-10-11 08:18:16 UTC (rev 16844)
@@ -1,8 +0,0 @@
-TYPE_UNIDENTIFIED=Type unidentified
-OBJECTTYPE_SHOULD_BE_SIMPLE_TYPE_OR_COMPLEX_TYPE=objectType should be simple type or complex type
-ILLEGAL_NAMESPACE=Illegal namespace
-TARGETNAMESPACE_CANNOT_BE=targetNamespace cannot be {0}
-NOT_A_GLOBAL_ELEMENT=Element is not a global element
-ILLEGAL_NULL_ARGUMENT=Illegal Null Argument:{0}
-PARSER_SHOULD_STOP=Parser should stop: {0}
-CANNOT_PARSE_XSMODEL=Cannot parse xsModelString: {0}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/WSSchemaUtils.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,11 +21,12 @@
*/
package org.jboss.ws.metadata.wsdl.xmlschema;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.IOException;
import java.io.Writer;
import java.util.Arrays;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -46,8 +47,6 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
@@ -61,7 +60,6 @@
public class WSSchemaUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSSchemaUtils.class);
private static final String xsNS = Constants.NS_SCHEMA_XSD;
private static SchemaUtils utils = SchemaUtils.getInstance();
@@ -93,9 +91,9 @@
List<String> knownNamespaces = Arrays.asList(nsarr);
boolean isCustom = false;
if (xsNS.equals(targetNS))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsNS"));
+ throw MESSAGES.illegalNullArgument("xsNS");
if (checkNS == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "checkNS"));
+ throw MESSAGES.illegalNullArgument("checkNS");
if (knownNamespaces.contains(checkNS) == false && targetNS.equals(checkNS) == false)
isCustom = true;
return isCustom;
@@ -246,7 +244,7 @@
if (xsmodel == null)
return true;
if (namespace == null)
- throw new WSException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "Target Namespace of xsmodel"));
+ throw MESSAGES.illegalNullArgument("Target Namespace of xsmodel");
XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, namespace);
XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, namespace);
@@ -314,7 +312,7 @@
{
XSTypeDefinition xst = xsel.getTypeDefinition();
if (xst == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "Type xst"));
+ throw MESSAGES.illegalNullArgument("Type xst");
boolean isGlobalRef = (xsel.getScope() == XSConstants.SCOPE_GLOBAL);
boolean isAnonType = xst.getAnonymous();
@@ -370,7 +368,7 @@
{
XSTypeDefinition xst = decl.getTypeDefinition();
if (xst == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "Type xst"));
+ throw MESSAGES.illegalNullArgument("Type xst");
boolean isGlobalRef = (decl.getScope() == XSConstants.SCOPE_GLOBAL);
boolean isAnonType = xst.getAnonymous();
@@ -418,7 +416,7 @@
{
boolean isAnonType = false;
if (XSConstants.SCOPE_GLOBAL != xsel.getScope())
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "NOT_A_GLOBAL_ELEMENT"));
+ throw MESSAGES.notAGlobalElement(xsel);
StringBuilder buf = new StringBuilder();
String elname = xsel.getName();
@@ -695,9 +693,9 @@
public void copyXSModel(XSModel xsmodel, JBossXSModel jb)
{
if (xsmodel == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsmodel"));
+ throw MESSAGES.illegalNullArgument("xsmodel");
if (jb == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "jb"));
+ throw MESSAGES.illegalNullArgument("jb");
//Copy all the Namespace Items
jb.setXSNamespaceItemList(xsmodel.getNamespaceItems());
//Copy all the elements
@@ -744,10 +742,10 @@
private String getPrefix(String namespace)
{
if (namespaceRegistry == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", namespaceRegistry));
+ throw MESSAGES.illegalNullArgument(namespaceRegistry);
if (namespace == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "namespace"));
+ throw MESSAGES.illegalNullArgument("namespace");
// XML Namespace can only legally be assigned the XML prefix
if (namespace.equals(Constants.NS_XML))
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/Message.properties 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/Message.properties 2012-10-11 08:18:16 UTC (rev 16844)
@@ -1,8 +0,0 @@
-EMPTY_UNION_TYPE=Empty union type not expected
-ABSENT_VARIETY=Absent variety is not supported in simple types
-BASE_TYPE_NOT_SIMPLE=Expected base type to be a simple type
-XMLNAME_HAS_NULL=xmlName has a null {0}
-CANNOT_PARSE_SCHEMA=Cannot parse schema: {0}
-TARGET_NAMESPACE_OF_XSMODEL_IS_NULL=Target Namespace of xsmodel is null
-INVALID_NULL_TNS=Invalid null target namespace
-ILLEGAL_NULL_ARGUMENT=Illegal Null Argument:{0}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -21,13 +21,14 @@
*/
package org.jboss.ws.metadata.wsdl.xsd;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -49,8 +50,6 @@
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
@@ -70,12 +69,11 @@
*/
public class SchemaUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(SchemaUtils.class);
private static SchemaUtils ourInstance = new SchemaUtils();
protected static final String xsNS = Constants.NS_SCHEMA_XSD;
- private static Map<Class, QName> toolsTypeMappingOverride = new HashMap<Class, QName>();
+ private static Map<Class<?>, QName> toolsTypeMappingOverride = new HashMap<Class<?>, QName>();
static
{
@@ -147,7 +145,7 @@
public static QName handleSimpleType(XSSimpleTypeDefinition simple)
{
if (simple == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "XSSimpleTypeDefinition"));
+ throw MESSAGES.illegalNullArgument("XSSimpleTypeDefinition");
//Check if the type of SimpleType is a plain xsd type
if (Constants.NS_SCHEMA_XSD.equals(simple.getNamespace()))
@@ -161,9 +159,9 @@
XSObjectList list = simple.getMemberTypes();
if (list.getLength() > 0)
return handleSimpleType((XSSimpleTypeDefinition)list.item(0));
- throw new WSException(BundleUtils.getMessage(bundle, "EMPTY_UNION_TYPE"));
+ throw MESSAGES.emptyUnionTypeNotExpected();
case XSSimpleTypeDefinition.VARIETY_ABSENT:
- throw new WSException(BundleUtils.getMessage(bundle, "ABSENT_VARIETY"));
+ throw MESSAGES.absentVariety();
}
XSTypeDefinition base = simple.getBaseType();
@@ -171,7 +169,7 @@
base = base.getBaseType();
if (!(base instanceof XSSimpleTypeDefinition))
- throw new WSException(BundleUtils.getMessage(bundle, "BASE_TYPE_NOT_SIMPLE"));
+ throw MESSAGES.baseTypeNotSimple();
return new QName(base.getNamespace(), base.getName());
}
@@ -239,16 +237,16 @@
public boolean hasGlobalElement(QName xmlName, XSModel xsmodel)
{
if (xmlName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xmlName"));
+ throw MESSAGES.illegalNullArgument("xmlName");
if (xsmodel == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsmodel"));
+ throw MESSAGES.illegalNullArgument("xsmodel");
boolean bool = false;
String name = xmlName.getLocalPart();
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL", "name"));
+ throw MESSAGES.xmlNameHasNull("name");
String ns = xmlName.getNamespaceURI();
if (ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL", "namespace"));
+ throw MESSAGES.xmlNameHasNull("namespace");
if (xsmodel.getElementDeclaration(name, ns) != null)
bool = true;
return bool;
@@ -263,7 +261,7 @@
public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
{
if (xsdLocation == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsdLocation"));
+ throw MESSAGES.illegalNullArgument("xsdLocation");
XSModel xsmodel = parseSchema(xsdLocation);
return this.hasComplexTypeDefinition(xmlType, xsmodel);
}
@@ -277,17 +275,17 @@
public boolean hasGlobalElement(QName xmlName, URL xsdLocation)
{
if (xmlName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xmlName"));
+ throw MESSAGES.illegalNullArgument("xmlName");
if (xsdLocation == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsdLocation"));
+ throw MESSAGES.illegalNullArgument("xsdLocation");
XSModel xsmodel = parseSchema(xsdLocation);
boolean bool = false;
String name = xmlName.getLocalPart();
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL","name"));
+ throw MESSAGES.xmlNameHasNull("name");
String ns = xmlName.getNamespaceURI();
if (ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL", "namespace"));
+ throw MESSAGES.xmlNameHasNull("namespace");
if (xsmodel.getElementDeclaration(name, ns) != null)
bool = true;
return bool;
@@ -302,16 +300,16 @@
public boolean hasComplexTypeDefinition(QName xmlType, XSModel xsmodel)
{
if (xmlType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xmlType"));
+ throw MESSAGES.illegalNullArgument("xmlType");
if (xsmodel == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsdmodel"));
+ throw MESSAGES.illegalNullArgument("xsdmodel");
boolean bool = false;
String name = xmlType.getLocalPart();
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL", "name"));
+ throw MESSAGES.xmlNameHasNull("name");
String ns = xmlType.getNamespaceURI();
if (ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "XMLNAME_HAS_NULL","namespace"));
+ throw MESSAGES.xmlNameHasNull("namespace");
if (xsmodel.getTypeDefinition(name, ns) != null)
bool = true;
return bool;
@@ -427,7 +425,7 @@
XSLoader xsloader = getXSLoader();
XSModel xsModel = xsloader.loadURI(schemaLoc);
if (xsModel == null)
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_PARSE_SCHEMA", schemaLoc));
+ throw MESSAGES.cannotParseSchema(schemaLoc);
return xsModel;
}
@@ -456,7 +454,7 @@
return true;
String targetNS = getTargetNamespace(xsmodel);
if (targetNS == null)
- throw new WSException(BundleUtils.getMessage(bundle, "TARGET_NAMESPACE_OF_XSMODEL_IS_NULL"));
+ throw MESSAGES.nullTargetNsXSModel();
XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, targetNS);
XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, targetNS);
@@ -479,7 +477,7 @@
if (xsmodel == null)
return true;
if (namespace == null)
- throw new WSException(BundleUtils.getMessage(bundle, "TARGET_NAMESPACE_OF_XSMODEL_IS_NULL"));
+ throw MESSAGES.nullTargetNsXSModel();
XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, namespace);
XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, namespace);
@@ -514,7 +512,7 @@
public static File getSchemaTempFile(String targetNS) throws IOException
{
if (targetNS.length() == 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_NULL_TNS"));
+ throw MESSAGES.illegalNullArgument("target namespace");
String fname = targetNS;
if (fname.indexOf("://") > 0)
@@ -524,7 +522,7 @@
try
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
+ ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
tmpdir = serverConfig.getServerTempDir();
tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
tmpdir.mkdirs();
@@ -549,7 +547,7 @@
public static String getTargetNamespace(XSModel xsmodel)
{
if (xsmodel == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsmodel"));
+ throw MESSAGES.illegalNullArgument("xsmodel");
String targetNS = null;
StringList slist = xsmodel.getNamespaces();
int len = slist != null ? slist.getLength() : 0;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2012-10-11 08:01:05 UTC (rev 16843)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/XSDWriter.java 2012-10-11 08:18:16 UTC (rev 16844)
@@ -28,11 +28,10 @@
import java.io.StringWriter;
import java.io.Writer;
import java.net.URL;
-import java.util.ResourceBundle;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
@@ -43,7 +42,6 @@
*/
public class XSDWriter
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(XSDWriter.class);
// provide logging
protected static final Logger log = Logger.getLogger(XSDWriter.class);
@@ -56,7 +54,7 @@
public void writeXSD(Writer writer, XSModel xsmodel, WSDLDefinitions wsdl)
{
if (xsmodel == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "xsmodel"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xsmodel");
this.wsdl = wsdl;
@@ -74,7 +72,7 @@
throws IOException
{
if(ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_NULL_ARGUMENT", "ns"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("ns");
String xsdString = "";
if(xsmodel instanceof JBossXSModel)
{
More information about the jbossws-commits
mailing list