You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2001/12/19 21:14:26 UTC

cvs commit: jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt XMLIntrospector.java

rdonkin     01/12/19 12:14:26

  Modified:    betwixt/src/java/org/apache/commons/betwixt
                        XMLIntrospector.java
  Log:
  Added logging using org.apache.commons.logging.Log
  
  Revision  Changes    Path
  1.10      +31 -3     jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java
  
  Index: XMLIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/betwixt/src/java/org/apache/commons/betwixt/XMLIntrospector.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLIntrospector.java	2001/12/11 06:43:47	1.9
  +++ XMLIntrospector.java	2001/12/19 20:14:26	1.10
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: XMLIntrospector.java,v 1.9 2001/12/11 06:43:47 sanders Exp $
  + * $Id: XMLIntrospector.java,v 1.10 2001/12/19 20:14:26 rdonkin Exp $
    */
   package org.apache.commons.betwixt;
   
  @@ -26,6 +26,9 @@
   import java.util.List;
   import java.util.Map;
   
  +import org.apache.commons.logging.LogSource;
  +import org.apache.commons.logging.Log;
  +
   import org.apache.commons.betwixt.expression.EmptyExpression;
   import org.apache.commons.betwixt.expression.Expression;
   import org.apache.commons.betwixt.expression.IteratorExpression;
  @@ -35,22 +38,47 @@
   /** <p><code>XMLIntrospector</code> an introspector of beans to create a XMLBeanInfo instance.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.9 $
  +  * @version $Revision: 1.10 $
     */
   public class XMLIntrospector {
   
       /** should attributes or elements be used for primitive types */
       private boolean attributesForPrimitives = true;
  +    /** Log used for logging (Doh!) */
  +    protected final Log log = LogSource.makeNewLogInstance("org.apache.commons.betwixt.XMLIntrospector");
  +
       
       /** Base constructor */
       public XMLIntrospector() {
       }
       
  +    /**
  +     * <p> Get the current level for logging. </p>
  +     *
  +     * @return a <code>org.apache.commons.logging.Log</code> level constant
  +     */ 
  +    public int getLogLevel() {
  +        return log.getLevel();
  +    }
  +
  +    /**
  +     * <p> Set the current logging level. </p>
  +     *
  +     * @param level a <code>org.apache.commons.logging.Log</code> level constant
  +     */ 
  +    public void setLogLevel(int level) {
  +        log.setLevel(level);
  +    }
  +    
  +    
       /** Create a standard <code>XMLBeanInfo</code> by introspection
           The actual introspection depends only on the <code>BeanInfo</code>
           associated with the bean.
           */
       public XMLBeanInfo introspect(Object bean) throws IntrospectionException {
  +        log.debug("Introspecting...");
  +        log.debug(bean);
  +        
           return introspect( bean.getClass() );
       }
       
  @@ -67,7 +95,7 @@
           The actual introspection depends only on the <code>BeanInfo</code>
           associated with the bean.
           */
  -    public XMLBeanInfo introspect(BeanInfo beanInfo) throws IntrospectionException {
  +    public XMLBeanInfo introspect(BeanInfo beanInfo) throws IntrospectionException {	
           XMLBeanInfo answer = createXMLBeanInfo( beanInfo );
   
           BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>