donaldp 02/01/25 03:26:46
Modified: proposal/myrmidon/src/java/org/apache/antlib/core
Resources.properties Property.java
Log:
Update to use new Service based access-point
Submitted By: "Adam Murdoch" <[EMAIL PROTECTED]>
Revision Changes Path
1.6 +4 -2
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties
Index: Resources.properties
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Resources.properties 12 Jan 2002 05:49:07 -0000 1.5
+++ Resources.properties 25 Jan 2002 11:26:45 -0000 1.6
@@ -1,4 +1,3 @@
-property.bad-factory.error=Unable to retrieve DataType factory from
TypeManager.
property.no-set.error=Unable to set datatype.
property.multi-set.error=Value can not be set multiple times.
property.no-name.error=Name must be specified.
@@ -23,4 +22,7 @@
getByName.error=Failed to retrieve enum by calling getByName on "{0}".
(Reason: {1}).
enum.missing.getByName.error=Enum class "{0}" is missing a public static
method named "getByName" that accepts a single string parameter.
enum.missing.getNames.error=Enum class "{0}" is missing a public static
method named "getNames" that returns a String array of all enum names.
-invalid.enum.error=Invalid value "{0}" for enum, expected one of {1}.
\ No newline at end of file
+invalid.enum.error=Invalid value "{0}" for enum, expected one of {1}.
+
+if.ifelse-duplicate.error=Can only set one of if/else for If task type.
+if.no-condition.error=No condition was specified for If task.
\ No newline at end of file
1.7 +3 -24
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Property.java 22 Jan 2002 11:47:14 -0000 1.6
+++ Property.java 25 Jan 2002 11:26:45 -0000 1.7
@@ -9,8 +9,6 @@
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -18,9 +16,7 @@
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.AbstractContainerTask;
import org.apache.myrmidon.framework.DataType;
-import org.apache.myrmidon.interfaces.type.TypeException;
import org.apache.myrmidon.interfaces.type.TypeFactory;
-import org.apache.myrmidon.interfaces.type.TypeManager;
/**
* This is the property "task" to declare a binding of a datatype to a name.
@@ -28,7 +24,7 @@
* TODO: Determine final format of property task.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.6 $ $Date: 2002/01/22 11:47:14 $
+ * @version $Revision: 1.7 $ $Date: 2002/01/25 11:26:45 $
* @ant:task name="property"
*/
public class Property
@@ -41,24 +37,6 @@
private String m_name;
private Object m_value;
private boolean m_localScope = true;
- private TypeFactory m_factory;
-
- public void compose( final ComponentManager componentManager )
- throws ComponentException
- {
- super.compose( componentManager );
-
- final TypeManager typeManager =
(TypeManager)componentManager.lookup( TypeManager.ROLE );
- try
- {
- m_factory = typeManager.getFactory( DataType.ROLE );
- }
- catch( final TypeException te )
- {
- final String message = REZ.getString(
"property.bad-factory.error" );
- throw new ComponentException( message, te );
- }
- }
public void configure( final Configuration configuration )
throws ConfigurationException
@@ -76,7 +54,8 @@
{
try
{
- final DataType value = (DataType)m_factory.create( children[
i ].getName() );
+ final TypeFactory typeFactory = getTypeFactory(
DataType.ROLE );
+ final DataType value = (DataType)typeFactory.create(
children[ i ].getName() );
configure( value, children[ i ] );
setValue( value );
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>