notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2117 - in development/main/metro/composition: api/src/main/net/dpml/composition/data impl/src/main/net/dpml/composition/data/builder impl/src/main/net/dpml/composition/model/impl impl/src/test/net/dpml/composition/model/impl/fileset
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2117 - in development/main/metro/composition: api/src/main/net/dpml/composition/data impl/src/main/net/dpml/composition/data/builder impl/src/main/net/dpml/composition/model/impl impl/src/test/net/dpml/composition/model/impl/fileset
- Date: Tue, 22 Mar 2005 11:47:54 -0500
Author: mcconnell AT dpml.net
Date: Tue Mar 22 11:47:54 2005
New Revision: 2117
Removed:
development/main/metro/composition/api/src/main/net/dpml/composition/data/ExcludeDirective.java
development/main/metro/composition/api/src/main/net/dpml/composition/data/IncludeDirective.java
Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/data/FilesetDirective.java
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLContainmentProfileCreator.java
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultClassLoaderModel.java
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultFilesetModel.java
development/main/metro/composition/impl/src/test/net/dpml/composition/model/impl/fileset/FilesetModelTestCase.java
Log:
Move the ImportDirective and ExportDirective to static inner clases within
the fileset directive (reducing noise in the api).
Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/data/FilesetDirective.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/data/FilesetDirective.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/data/FilesetDirective.java
Tue Mar 22 11:47:54 2005
@@ -49,12 +49,12 @@
/**
* The set of include directives.
*/
- private final IncludeDirective[] m_includes;
+ private final Include[] m_includes;
/**
* The set of exclude directives.
*/
- private final ExcludeDirective[] m_excludes;
+ private final Exclude[] m_excludes;
/**
* Create a FilesetDirective instance.
@@ -62,7 +62,7 @@
* @param base the base directory path against which includes are
evaluated
* @param includes the set of includes to include in the fileset
*/
- public FilesetDirective( final String base, final IncludeDirective[]
includes )
+ public FilesetDirective( final String base, final Include[] includes )
{
this(base, includes, null);
}
@@ -73,8 +73,8 @@
* @param base the base directory path against which includes are
evaluated
* @param includes the set of includes to include in the fileset
*/
- public FilesetDirective( final String base, final IncludeDirective[]
includes,
- final ExcludeDirective[] excludes)
+ public FilesetDirective( final String base, final Include[] includes,
+ final Exclude[] excludes)
{
m_base = base;
m_includes = includes;
@@ -96,7 +96,7 @@
*
* @return the include set
*/
- public IncludeDirective[] getIncludes()
+ public Include[] getIncludes()
{
return m_includes;
}
@@ -106,8 +106,98 @@
*
* @return the exclude set
*/
- public ExcludeDirective[] getExcludes()
+ public Exclude[] getExcludes()
{
return m_excludes;
}
+
+ /**
+ * <p>A file exclude directive.</p>
+ * <p><b>XML</b></p>
+ * <p>An exclude element is normally contained within a scoping structure
such as a
+ * fileset or directory set. The exclude element contains the single
attribute name
+ * which is used to refer to the file or directory (depending on the
containing
+ * context.</p>
+ * <pre>
+ * <font color="gray"><fileset dir="lib"></font>
+ * <exclude name="<font
color="darkred">avalon-framework.jar</font>" />
+ * <font color="gray"></fileset></font>
+ * </pre>
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital
Product Meta Library</a>
+ * @version $Id$
+ */
+ public static class Exclude implements Serializable
+ {
+
+ /**
+ * The base directory
+ */
+ private final String m_path;
+
+ /**
+ * Create an ExcludeDirective instance.
+ *
+ * @param path the path to include
+ */
+ public Exclude( final String path )
+ {
+ m_path = path;
+ }
+
+ /**
+ * Return the excluded path.
+ *
+ * @return the path
+ */
+ public String getPath()
+ {
+ return m_path;
+ }
+ }
+
+ /**
+ * <p>An file include directive.</p>
+ * <p><b>XML</b></p>
+ * <p>An include element is normally contained within a scoping structure
such as a
+ * fileset or directory set. The include element contains the single
attribute name
+ * which is used to refer to the file or directory (depending on the
containing
+ * context.</p>
+ * <pre>
+ * <font color="gray"><fileset dir="lib"></font>
+ * <include name="<font
color="darkred">avalon-framework.jar</font>" />
+ * <font color="gray"></fileset></font>
+ * </pre>
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital
Product Meta Library</a>
+ * @version $Id$
+ */
+ public static class Include implements Serializable
+ {
+
+ /**
+ * The base directory
+ */
+ private final String m_path;
+
+ /**
+ * Create a IncludeDirective instance.
+ *
+ * @param path the path to include
+ */
+ public Include( final String path )
+ {
+ m_path = path;
+ }
+
+ /**
+ * Return the included path.
+ *
+ * @return the path
+ */
+ public String getPath()
+ {
+ return m_path;
+ }
+ }
}
Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLContainmentProfileCreator.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLContainmentProfileCreator.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLContainmentProfileCreator.java
Tue Mar 22 11:47:54 2005
@@ -24,9 +24,9 @@
import net.dpml.composition.data.ClasspathDirective;
import net.dpml.composition.data.ContainmentProfile;
import net.dpml.composition.data.DeploymentProfile;
-import net.dpml.composition.data.ExcludeDirective;
import net.dpml.composition.data.FilesetDirective;
-import net.dpml.composition.data.IncludeDirective;
+import net.dpml.composition.data.FilesetDirective.Exclude;
+import net.dpml.composition.data.FilesetDirective.Include;
import net.dpml.composition.data.MetaDataException;
import net.dpml.composition.data.NamedComponentProfile;
import net.dpml.composition.data.ServiceDirective;
@@ -228,8 +228,8 @@
throws ConfigurationException
{
String base = config.getAttribute( "dir", "." );
- IncludeDirective[] includes = createIncludeDirectives( config );
- ExcludeDirective[] excludes = createExcludeDirectives( config );
+ Include[] includes = createIncludeDirectives( config );
+ Exclude[] excludes = createExcludeDirectives( config );
return new FilesetDirective( base, includes, excludes );
}
@@ -240,12 +240,12 @@
* @exception ConfigurationException if the configuration is
* incomplete
*/
- protected IncludeDirective[] createIncludeDirectives( Configuration
config )
+ protected Include[] createIncludeDirectives( Configuration config )
throws ConfigurationException
{
if( config == null )
{
- return new IncludeDirective[0];
+ return new Include[0];
}
ArrayList list = new ArrayList();
@@ -256,7 +256,7 @@
list.add( createIncludeDirective( child ) );
}
- return (IncludeDirective[]) list.toArray( new IncludeDirective[0] );
+ return (Include[]) list.toArray( new Include[0] );
}
/**
@@ -266,12 +266,12 @@
* @exception ConfigurationException if the configuration is
* incomplete
*/
- protected ExcludeDirective[] createExcludeDirectives( Configuration
config )
+ protected Exclude[] createExcludeDirectives( Configuration config )
throws ConfigurationException
{
if( config == null )
{
- return new ExcludeDirective[0];
+ return new Exclude[0];
}
ArrayList list = new ArrayList();
@@ -282,7 +282,7 @@
list.add( createExcludeDirective( child ) );
}
- return (ExcludeDirective[]) list.toArray( new ExcludeDirective[0] );
+ return (Exclude[]) list.toArray( new Exclude[0] );
}
/**
@@ -293,10 +293,10 @@
* @exception ConfigurationException if the configuration does not
* declare the name attribute
*/
- protected IncludeDirective createIncludeDirective( Configuration config )
+ protected Include createIncludeDirective( Configuration config )
throws ConfigurationException
{
- return new IncludeDirective( getIncludeValue( config ) );
+ return new Include( getIncludeValue( config ) );
}
/**
@@ -307,10 +307,10 @@
* @exception ConfigurationException if the configuration does not
* declare the name attribute
*/
- protected ExcludeDirective createExcludeDirective( Configuration config )
+ protected Exclude createExcludeDirective( Configuration config )
throws ConfigurationException
{
- return new ExcludeDirective( getExcludeValue( config ) );
+ return new Exclude( getExcludeValue( config ) );
}
private String getIncludeValue( Configuration config )
Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultClassLoaderModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultClassLoaderModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultClassLoaderModel.java
Tue Mar 22 11:47:54 2005
@@ -37,9 +37,9 @@
import net.dpml.composition.data.ClasspathDirective;
import net.dpml.composition.data.ContainmentProfile;
-import net.dpml.composition.data.ExcludeDirective;
import net.dpml.composition.data.FilesetDirective;
-import net.dpml.composition.data.IncludeDirective;
+import net.dpml.composition.data.FilesetDirective.Exclude;
+import net.dpml.composition.data.FilesetDirective.Include;
import net.dpml.composition.model.ClassLoaderModel;
import net.dpml.composition.model.ModelException;
@@ -439,8 +439,8 @@
File anchor = getDirectory( base, fileset.getBaseDirectory() );
getLocalLogger().debug("anchor=[" + anchor + "]");
- IncludeDirective[] includes = fileset.getIncludes();
- ExcludeDirective[] excludes = fileset.getExcludes();
+ Include[] includes = fileset.getIncludes();
+ Exclude[] excludes = fileset.getExcludes();
DefaultFilesetModel fsm = new DefaultFilesetModel(
anchor, includes, excludes, null, null, getLocalLogger());
Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultFilesetModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultFilesetModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultFilesetModel.java
Tue Mar 22 11:47:54 2005
@@ -21,16 +21,17 @@
import java.io.IOException;
import java.util.ArrayList;
-import net.dpml.composition.data.ExcludeDirective;
-import net.dpml.composition.data.IncludeDirective;
+
+import net.dpml.composition.data.FilesetDirective.Exclude;
+import net.dpml.composition.data.FilesetDirective.Include;
import net.dpml.composition.model.FilesetModel;
import net.dpml.logging.Logger;
/**
* Implementation of a <code>FilesetModel</code> in which a set
- * of <code>IncludeDirective</code> objects, a set of
- * <code>ExcludeDirective</code> objects, a set of default
+ * of <code>Include</code> objects, a set of
+ * <code>Exclude</code> objects, a set of default
* includes and excludes, and a base directory anchor are used
* to resolve and build a set of files specified by a
* <code>FilesetDirective</code>.
@@ -46,15 +47,15 @@
*/
private File m_anchor = null;
/**
- * Array of <code>IncludeDirective</code> objects to use during
+ * Array of <code>Include</code> objects to use during
* fileset resolution.
*/
- private IncludeDirective[] m_includes = null;
+ private Include[] m_includes = null;
/**
- * Array of <code>ExcludeDirective</code> objects to use during
+ * Array of <code>Exclude</code> objects to use during
* fileset resolution.
*/
- private ExcludeDirective[] m_excludes = null;
+ private Exclude[] m_excludes = null;
/**
* Array of <code>String</code> objects to use as a default set
* of fileset includes.
@@ -80,9 +81,9 @@
*
* @param anchor base directory anchor from which to begin
* fileset resolution
- * @param includes array of <code>IncludeDirective</code> objects
+ * @param includes array of <code>Include</code> objects
* to use during fileset resolution
- * @param excludes array of <code>ExcludeDirective</code> objects
+ * @param excludes array of <code>Exclude</code> objects
* to use during fileset resolution
* @param defaultIncludes array of <code>String</code> objects
* to use as a default set of fileset includes
@@ -90,8 +91,8 @@
* to use as a default set of fileset excludes
* @param logger <code>Logger</code> for the fileset model to use
*/
- public DefaultFilesetModel(File anchor, IncludeDirective[] includes,
- ExcludeDirective[] excludes, String[] defaultIncludes,
+ public DefaultFilesetModel(File anchor, Include[] includes,
+ Exclude[] excludes, String[] defaultIncludes,
String[] defaultExcludes, Logger logger)
{
m_logger = logger;
@@ -113,29 +114,29 @@
}
/**
- * Establishes the set of <code>IncludeDirective</code> objects
+ * Establishes the set of <code>Include</code> objects
* to use during fileset resolution.
*
- * @param includes array of <code>IncludeDirective</code> objects
+ * @param includes array of <code>Include</code> objects
*/
- private void setIncludeDirectives(IncludeDirective[] includes) {
+ private void setIncludeDirectives(Include[] includes) {
m_includes = includes;
}
/**
- * Establishes the set of <code>ExcludeDirective</code> objects
+ * Establishes the set of <code>Exclude</code> objects
* to use during fileset resolution.
*
* @param excludes array of <code>ExcludeDirectives</code>
*/
- private void setExcludeDirectives(ExcludeDirective[] excludes) {
+ private void setExcludeDirectives(Exclude[] excludes) {
m_excludes = excludes;
}
/**
* Establishes a set of default includes to use during fileset
* resolution in lieu of an explicit specification of a set
- * of <code>IncludeDirective</code> objects.
+ * of <code>Include</code> objects.
*
* @param defaultIncludes array of <code>String</code> objects
* representing a set of default fileset includes
@@ -153,7 +154,7 @@
/**
* Establishes a set of default excludes to use during fileset
* resolution in lieu of an explicit specification of a set
- * of <code>ExcludeDirective</code> objects.
+ * of <code>Exclude</code> objects.
*
* @param defaultExcludes array of <code>String</code> objects
* representing a set of default fileset excludes
@@ -222,7 +223,7 @@
// Supply the directory scanner with our set of includes.
// The scanner wants the includes in the form of String[],
- // but we have them in the form of IncludeDirective[].
+ // but we have them in the form of Include[].
// So.. we need to first convert...
String[] includes = new String[ m_includes.length ];
if (m_includes.length == 0)
Modified:
development/main/metro/composition/impl/src/test/net/dpml/composition/model/impl/fileset/FilesetModelTestCase.java
==============================================================================
---
development/main/metro/composition/impl/src/test/net/dpml/composition/model/impl/fileset/FilesetModelTestCase.java
(original)
+++
development/main/metro/composition/impl/src/test/net/dpml/composition/model/impl/fileset/FilesetModelTestCase.java
Tue Mar 22 11:47:54 2005
@@ -24,8 +24,8 @@
import junit.framework.TestCase;
import net.dpml.composition.data.FilesetDirective;
-import net.dpml.composition.data.IncludeDirective;
-import net.dpml.composition.data.ExcludeDirective;
+import net.dpml.composition.data.FilesetDirective.Include;
+import net.dpml.composition.data.FilesetDirective.Exclude;
import net.dpml.composition.model.impl.DefaultFilesetModel;
import net.dpml.logging.provider.ConsoleLogger;
@@ -80,8 +80,8 @@
public void testBadBaseDirectory() throws Exception
{
// only testing a bad base directory -- no includes or excludes
necessary
- IncludeDirective[] includes = new IncludeDirective[0];
- ExcludeDirective[] excludes = new ExcludeDirective[0];
+ Include[] includes = new Include[0];
+ Exclude[] excludes = new Exclude[0];
// make up a *bad* fileset directory attribute
FilesetDirective fsd = new FilesetDirective( "junk", includes,
excludes );
@@ -124,8 +124,8 @@
public void testZeroIncludesExcludes() throws Exception
{
// testing empty include/exclude directives
- IncludeDirective[] includes = new IncludeDirective[0];
- ExcludeDirective[] excludes = new ExcludeDirective[0];
+ Include[] includes = new Include[0];
+ Exclude[] excludes = new Exclude[0];
// provide legitimate fileset directory attribute
final String dir = ".";
@@ -184,11 +184,11 @@
public void testWildcardIncludes() throws Exception
{
// testing an include directive = "*.widget"
- IncludeDirective[] includes = new IncludeDirective[1];
- includes[0] = new IncludeDirective( "*.widget" );
+ Include[] includes = new Include[1];
+ includes[0] = new Include( "*.widget" );
// testing empty exclude directives
- ExcludeDirective[] excludes = new ExcludeDirective[0];
+ Exclude[] excludes = new Exclude[0];
// provide legitimate fileset directory attribute
final String dir = "fileset";
@@ -254,12 +254,12 @@
public void testIncludeExcludes() throws Exception
{
// testing an include directive = "*.widget"
- IncludeDirective[] includes = new IncludeDirective[1];
- includes[0] = new IncludeDirective( "*.widget" );
+ Include[] includes = new Include[1];
+ includes[0] = new Include( "*.widget" );
// testing an exclude directive = "test*.widget"
- ExcludeDirective[] excludes = new ExcludeDirective[1];
- excludes[0] = new ExcludeDirective( "test*.widget" );
+ Exclude[] excludes = new Exclude[1];
+ excludes[0] = new Exclude( "test*.widget" );
// provide legitimate fileset directory attribute
final String dir = "fileset";
@@ -325,11 +325,11 @@
public void testRecursiveIncludes() throws Exception
{
// testing an include directive = "**/*.widget"
- IncludeDirective[] includes = new IncludeDirective[1];
- includes[0] = new IncludeDirective( "**/*.widget" );
+ Include[] includes = new Include[1];
+ includes[0] = new Include( "**/*.widget" );
// testing empty exclude directives
- ExcludeDirective[] excludes = new ExcludeDirective[0];
+ Exclude[] excludes = new Exclude[0];
// provide legitimate fileset directory attribute
final String dir = "fileset";
- svn commit: r2117 - in development/main/metro/composition: api/src/main/net/dpml/composition/data impl/src/main/net/dpml/composition/data/builder impl/src/main/net/dpml/composition/model/impl impl/src/test/net/dpml/composition/model/impl/fileset, mcconnell, 03/21/2005
Archive powered by MHonArc 2.6.24.