You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sc...@apache.org on 2010/04/13 23:36:39 UTC
svn commit: r933790 -
/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java
Author: scheu
Date: Tue Apr 13 21:36:38 2010
New Revision: 933790
URL: http://svn.apache.org/viewvc?rev=933790&view=rev
Log:
Add trace to record JAX-WS BindingProperty settings
Modified:
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java
Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java?rev=933790&r1=933789&r2=933790&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java (original)
+++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyValidator.java Tue Apr 13 21:36:38 2010
@@ -20,10 +20,17 @@
package org.apache.axis2.jaxws.client;
import javax.xml.ws.BindingProvider;
+
+import org.apache.axis2.util.JavaUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import java.util.HashMap;
public class PropertyValidator {
+ private static final Log log = LogFactory.getLog(PropertyValidator.class);
+
private static HashMap<String, Class> map = new HashMap<String, Class>();
static {
@@ -44,11 +51,30 @@ public class PropertyValidator {
* @return
*/
public static boolean validate(String propName, Object value) {
+ if (log.isDebugEnabled()) {
+ String valueText;
+ if (BindingProvider.USERNAME_PROPERTY.equals(propName) ||
+ BindingProvider.PASSWORD_PROPERTY.equals(propName)) {
+ valueText = "xxxxxx";
+ } else if (value == null) {
+ valueText = "null";
+ } else if (value instanceof String ||
+ value instanceof Boolean ||
+ value instanceof Integer) {
+ valueText = value.toString();
+ } else {
+ valueText = JavaUtils.getObjectIdentity(value);
+ }
+ log.debug("validate property=(" + propName + ") with value=(" + valueText + ")");
+ }
Class expectedType = map.get(propName);
if (expectedType != null) {
if (expectedType.equals(value.getClass())) {
return true;
} else {
+ if (log.isDebugEnabled()) {
+ log.debug(" not a valid property. Expected a value of type " + expectedType);
+ }
return false;
}
}