From af9fedaddcecbe135f7e3b6158799d524a7d2150 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Fri, 25 Jan 2002 11:26:45 +0000 Subject: [PATCH] Update to use new Service based access-point Submitted By: "Adam Murdoch" git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270851 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/antlib/core/Property.java | 25 ++----------------- .../apache/antlib/core/Resources.properties | 6 +++-- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java b/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java index fc7eaf8ee..dc058890b 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/core/Property.java @@ -9,8 +9,6 @@ package org.apache.antlib.core; 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.TaskContext; 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. @@ -41,24 +37,6 @@ public class Property 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 @@ public class Property { 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 ); } diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties b/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties index a374dcc5b..17479b5fd 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/antlib/core/Resources.properties @@ -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 @@ convert.bad-url.error=Error converting object ({0}) to URL. 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