cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: svn commit: r550965 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/core/src/main/java/org/apache/cxf/bus/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/resources/META-INF/ rt/core/src/...
Date Tue, 26 Jun 2007 23:22:45 GMT
Am Dienstag, den 26.06.2007, 21:50 +0000 schrieb dandiep@apache.org:
> Author: dandiep
> Date: Tue Jun 26 14:50:27 2007
> New Revision: 550965
> 
> ==============================================================================
> --- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(added)
> +++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Tue Jun 26 14:50:27 2007
> @@ -0,0 +1,325 @@
> +/**
> +
> +public abstract class AbstractBeanDefinitionParser 
> +            
> +            if ("createdFromAPI".equals(name)) {
> +                bean.setAbstract(true);
> +            } else if ("abstract".equals(name)) {
> +                bean.setAbstract(true);
> +            } else if (!"id".equals(name) && !"name".equals(name)) {

else if (isMappableAttribute(null, name)) {

> +                if ("bus".equals(name)) {
> +                    setBus = true;
> +                } 
> +                mapAttribute(bean, element, name, val);
> +            }
> +        }
> +        
> +    
> +    protected boolean isAttribute(String pre, String name) {
> +        return !"xmlns".equals(name) && (pre == null || !pre.equals("xmlns"))
> +            && !"abstract".equals(name) && !"lazy-init".equals(name)
&& !"id".equals(name);
> +    }
> +


You might wish to rename this method to isMappableAttribute() and,
within it, centralize the logic of which elements are mappable similar
to above and below.  To do this, though, checking for "name" to the
isMappableAttribute() will need to be added.  (For performance, you
could also remove checking for "abstract" from this method, because you
filter it out anyway in both doParse() methods; OTOH, to be complete you
may wish to keep it and add the other one--"createdFromAPI"--as well.)


> + */
> +public abstract class AbstractFactoryBeanDefinitionParser extends AbstractBeanDefinitionParser
{
> +    
> +    @Override
> +    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder
bean) {
...
> +            
> +            if ("createdFromAPI".equals(name)) {
> +                factoryBean.setAbstract(true);
> +                bean.setAbstract(true);
> +                createdFromAPI = true;
> +            } else if ("abstract".equals(name)) {
> +                factoryBean.setAbstract(true);
> +                bean.setAbstract(true);
> +            } else if (!"id".equals(name) && !"name".equals(name) &&
isAttribute(pre, name)) {

else if (isMappableAttribute(pre, name)) {

> +                if ("bus".equals(name)) {
> +                    setBus = true;
> +                }
> +                mapAttribute(factoryBean, element, name, val);
> +            } 
> +        }


Glen



Mime
View raw message