From ba3ce635bf43e25855d92a3234614364c33f247f Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Wed, 7 Feb 2001 05:35:46 +0000 Subject: [PATCH] Removed datatype package as it doesn't make sense for it to exist independent of tasklet hierarchy. Moved Pattern to modules hierarchy while others moved to tasklet hierarchy git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268598 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/ant/datatypes/DataType.java | 22 ----- .../apache/ant/datatypes/DataTypeEngine.java | 43 --------- .../ant/datatypes/DefaultDataTypeEngine.java | 70 -------------- .../org/apache/ant/datatypes/Pattern.java | 95 ------------------- 4 files changed, 230 deletions(-) delete mode 100644 proposal/myrmidon/src/java/org/apache/ant/datatypes/DataType.java delete mode 100644 proposal/myrmidon/src/java/org/apache/ant/datatypes/DataTypeEngine.java delete mode 100644 proposal/myrmidon/src/java/org/apache/ant/datatypes/DefaultDataTypeEngine.java delete mode 100644 proposal/myrmidon/src/java/org/apache/ant/datatypes/Pattern.java diff --git a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataType.java b/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataType.java deleted file mode 100644 index 48a9e311f..000000000 --- a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE file. - */ -package org.apache.ant.datatypes; - -import org.apache.avalon.Component; - -/** - * Base class for those classes that can appear inside the build file - * as stand alone data types. - * - * @author Stefan Bodewig - * @author Peter Donald - */ -public interface DataType - extends Component -{ -} diff --git a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataTypeEngine.java b/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataTypeEngine.java deleted file mode 100644 index 7b7f00fe1..000000000 --- a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DataTypeEngine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE file. - */ -package org.apache.ant.datatypes; - -import org.apache.avalon.Component; -import org.apache.avalon.Loggable; -import org.apache.avalon.camelot.FactoryException; -import org.apache.avalon.camelot.LocatorRegistry; -import org.apache.avalon.camelot.RegistryException; - -/** - * This is basically a engine that can be used to access data-types. - * The engine acts as a repository and factory for these types. - * - * @author Peter Donald - */ -public interface DataTypeEngine - extends Component -{ - /** - * Retrieve registry of data-types. - * This is used by deployer to add types into engine. - * - * @return the registry - */ - LocatorRegistry getRegistry(); - - /** - * Create a data-type of type registered under name. - * - * @param name the name of data type - * @return the DataType - * @exception RegistryException if an error occurs - * @exception FactoryException if an error occurs - */ - DataType createDataType( String name ) - throws RegistryException, FactoryException; -} diff --git a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DefaultDataTypeEngine.java b/proposal/myrmidon/src/java/org/apache/ant/datatypes/DefaultDataTypeEngine.java deleted file mode 100644 index 86c509727..000000000 --- a/proposal/myrmidon/src/java/org/apache/ant/datatypes/DefaultDataTypeEngine.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE file. - */ -package org.apache.ant.datatypes; - -import org.apache.avalon.Composer; -import org.apache.avalon.ComponentManager; -import org.apache.avalon.ComponentManagerException; -import org.apache.avalon.Composer; -import org.apache.avalon.camelot.DefaultLocatorRegistry; -import org.apache.avalon.camelot.Factory; -import org.apache.avalon.camelot.FactoryException; -import org.apache.avalon.camelot.Locator; -import org.apache.avalon.camelot.LocatorRegistry; -import org.apache.avalon.camelot.RegistryException; - -/** - * This is basically a engine that can be used to access data-types. - * The engine acts as a repository and factory for these types. - * - * @author Peter Donald - */ -public class DefaultDataTypeEngine - implements DataTypeEngine, Composer -{ - protected Factory m_factory; - protected LocatorRegistry m_registry = new DefaultLocatorRegistry(); - - /** - * Retrieve registry of data-types. - * This is used by deployer to add types into engine. - * - * @return the registry - */ - public LocatorRegistry getRegistry() - { - return m_registry; - } - - /** - * Retrieve relevent services needed to deploy. - * - * @param componentManager the ComponentManager - * @exception ComponentManagerException if an error occurs - */ - public void compose( final ComponentManager componentManager ) - throws ComponentManagerException - { - m_factory = (Factory)componentManager.lookup( "org.apache.avalon.camelot.Factory" ); - } - - /** - * Create a data-type of type registered under name. - * - * @param name the name of data type - * @return the DataType - * @exception RegistryException if an error occurs - * @exception FactoryException if an error occurs - */ - public DataType createDataType( final String name ) - throws RegistryException, FactoryException - { - final Locator locator = m_registry.getLocator( name ); - return (DataType)m_factory.create( locator, DataType.class ); - } -} diff --git a/proposal/myrmidon/src/java/org/apache/ant/datatypes/Pattern.java b/proposal/myrmidon/src/java/org/apache/ant/datatypes/Pattern.java deleted file mode 100644 index 4b7cfbcdc..000000000 --- a/proposal/myrmidon/src/java/org/apache/ant/datatypes/Pattern.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE file. - */ -package org.apache.ant.datatypes; - -import org.apache.ant.AntException; -import org.apache.ant.util.Condition; - -/** - * Basic data type for holding patterns. - * - * @author Peter Donald - */ -public class Pattern - implements DataType -{ - protected String m_name; - protected Condition m_condition; - - /** - * Retrieve name (aka value) of pattern. - * - * @return the name/value of pattern - */ - public String getName() - { - return m_name; - } - - /** - * Get condition associated with pattern if any. - * - * @return the Condition - */ - public Condition getCondition() - { - return m_condition; - } - - /** - * Setter method for name/value of pattern. - * Conforms to ant setter patterns - * - * @param name the value - */ - public void setName( final String name ) - { - m_name = name; - } - - /** - * Set if clause on pattern. - * - * @param condition the condition - * @exception AntException if an error occurs - */ - public void setIf( final String condition ) - throws AntException - { - verifyConditionNull(); - m_condition = new Condition( true, condition ); - } - - /** - * Set unless clause of pattern. - * - * @param condition the unless clause - * @exception AntException if an error occurs - */ - public void setUnless( final String condition ) - throws AntException - { - verifyConditionNull(); - m_condition = new Condition( false, condition ); - } - - /** - * Utility method to make sure condition unset. - * Made so that it is not possible for both if and unless to be set. - * - * @exception AntException if an error occurs - */ - protected void verifyConditionNull() - throws AntException - { - if( null != m_condition ) - { - throw new AntException( "Can only set one of if/else for pattern data type" ); - } - } -}