You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by un...@apache.org on 2003/10/23 18:54:32 UTC

cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source SourceInspector.java

unico       2003/10/23 09:54:32

  Modified:    src/blocks/repository/java/org/apache/cocoon/components/source
                        SourceInspector.java
  Log:
  add method getExposedSourcePropertyTypes()
  improve documentation
  
  Revision  Changes    Path
  1.2       +34 -6     cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/SourceInspector.java
  
  Index: SourceInspector.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/SourceInspector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceInspector.java	22 Oct 2003 18:53:06 -0000	1.1
  +++ SourceInspector.java	23 Oct 2003 16:54:31 -0000	1.2
  @@ -50,14 +50,12 @@
   package org.apache.cocoon.components.source;
   
   import org.apache.avalon.framework.component.Component;
  -
  +import org.apache.cocoon.components.source.helpers.SourceProperty;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   
  -import org.apache.cocoon.components.source.helpers.SourceProperty;
  -
   /**
  - * A source inspector helps to get properties from sources
  + * A source inspector exposes source properties.
    *
    * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version CVS $Id$
  @@ -66,10 +64,40 @@
   
       public final static String ROLE = "org.apache.cocoon.components.source.SourceInspector";
   
  +    /**
  +     * Gets the SourceProperty associated with the given Source identified 
  +     * by the requested namespace and name.
  +     * 
  +     * @param source  the source for which to compute the property
  +     * @param namespace  the namespace uri of the property
  +     * @param name  the name of the property
  +     * @return  the SourceProperty associated with the Source, <code>null</code>
  +     * if the inspector does not provide this property.
  +     * @throws SourceException
  +     */
       public SourceProperty getSourceProperty(Source source, String namespace, String name) 
           throws SourceException;
   
  +    /**
  +     * Gets all the SourceProperties associated with the given Source.
  +     * 
  +     * @param source  the Source for wich to compute the property.
  +     * @return  the collection of all SourceProperties that could be computed
  +     * by this SourceInspector.
  +     * @throws SourceException  
  +     */
       public SourceProperty[] getSourceProperties(Source source) throws SourceException;
  -
  +    
  +    /**
  +     * Gets the list of all SourceProperties that are handled by this SourceInspector.
  +     * The Strings it returns follow the following format:
  +     * <p>
  +     * <code>
  +     *  SourceProperty::getNamespace() + "#" + SourceProperty.getName()
  +     * </code>
  +     * </p>
  +     * @return  the list of SourceProperties supported by this SourceInspector.
  +     */
  +    public String[] getExposedSourcePropertyTypes();
   }