Author: amilas Date: Thu Dec 13 21:19:21 2007 New Revision: 604106 URL: http://svn.apache.org/viewvc?rev=604106&view=rev Log: improve the exclude bean properties method to enable users to use the regulare expressions to specify the class names, exclude and include properties.
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=604106&r1=604105&r2=604106&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original) +++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Thu Dec 13 21:19:21 2007 @@ -24,6 +24,8 @@ import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory; import org.apache.axiom.om.util.Base64; import org.apache.axis2.AxisFault; +import org.apache.axis2.deployment.util.BeanExcludeInfo; +import org.apache.axis2.deployment.util.ExcludeInfo; import org.apache.axis2.context.MessageContext; import org.apache.axis2.description.java2wsdl.TypeTable; import org.apache.axis2.description.AxisService; @@ -107,12 +109,12 @@ } AxisService axisService = null; - if (MessageContext.getCurrentMessageContext() !=null) { + if (MessageContext.getCurrentMessageContext() != null) { axisService = MessageContext.getCurrentMessageContext().getAxisService(); } - ArrayList excludes = null; - if (axisService !=null && axisService.getBeanExludeMap() !=null) { - excludes = (ArrayList) axisService.getBeanExludeMap().get( + BeanExcludeInfo beanExcludeInfo = null; + if (axisService != null && axisService.getExcludeInfo() != null) { + beanExcludeInfo = axisService.getExcludeInfo().getBeanExcludeInfoForClass( jClass.getQualifiedName()); } // properties from JAM @@ -120,33 +122,24 @@ JProperty properties [] = jClass.getDeclaredProperties(); for (int i = 0; i < properties.length; i++) { JProperty property = properties[i]; - if (excludes != null && excludes.contains("*")) { - continue; + String propertyName = getCorrectName(property.getSimpleName()); + if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcluedProperty(propertyName)){ + propertyList.add(property); } - //Excluding properties if it is suppose to be - if(excludes != null && excludes.contains( - getCorrectName(getCorrectName(property.getSimpleName())))) { - continue; - } - propertyList.add(property); + } JClass supClass = jClass.getSuperclass(); while (!supClass.getQualifiedName().startsWith("java.")) { properties = supClass.getDeclaredProperties(); - Map map = axisService.getBeanExludeMap(); - if (map != null) { - excludes = (ArrayList) map.get(supClass.getQualifiedName()); + ExcludeInfo excludeInfo = axisService.getExcludeInfo(); + if (excludeInfo != null) { + beanExcludeInfo = excludeInfo.getBeanExcludeInfoForClass(supClass.getQualifiedName()); for (int i = 0; i < properties.length; i++) { JProperty property = properties[i]; - if (excludes != null && excludes.contains("*")) { - continue; - } - //Excluding properties if it is suppose to be - if(excludes != null && excludes.contains( - getCorrectName(getCorrectName(property.getSimpleName())))) { - continue; + String propertyName = getCorrectName(property.getSimpleName()); + if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcluedProperty(propertyName)) { + propertyList.add(property); } - propertyList.add(property); } } supClass = supClass.getSuperclass(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]