From 24c5d3e7cbe367940433e5061cd2be5d1855811f Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 30 Dec 2001 00:17:46 +0000 Subject: [PATCH] Moved MapperType inner class to top level class. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270420 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/types/MapperType.java | 44 +++++++++++++++++++ .../apache/tools/ant/types/MapperType.java | 44 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 proposal/myrmidon/src/main/org/apache/tools/ant/types/MapperType.java create mode 100644 proposal/myrmidon/src/todo/org/apache/tools/ant/types/MapperType.java diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/types/MapperType.java b/proposal/myrmidon/src/main/org/apache/tools/ant/types/MapperType.java new file mode 100644 index 000000000..5b0df32af --- /dev/null +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/types/MapperType.java @@ -0,0 +1,44 @@ +/* + * 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.txt file. + */ +package org.apache.tools.ant.types; + +import java.util.Properties; + +/** + * Class as Argument to FileNameMapper.setType. + */ +public class MapperType + extends EnumeratedAttribute +{ + private final Properties m_implementations; + + public MapperType() + { + m_implementations = new Properties(); + m_implementations.put( "identity", + "org.apache.tools.ant.util.IdentityMapper" ); + m_implementations.put( "flatten", + "org.apache.tools.ant.util.FlatFileNameMapper" ); + m_implementations.put( "glob", + "org.apache.tools.ant.util.GlobPatternMapper" ); + m_implementations.put( "merge", + "org.apache.tools.ant.util.MergingMapper" ); + m_implementations.put( "regexp", + "org.apache.tools.ant.util.RegexpPatternMapper" ); + } + + public String getImplementation() + { + return m_implementations.getProperty( getValue() ); + } + + public String[] getValues() + { + return new String[]{"identity", "flatten", "glob", "merge", "regexp"}; + } +} diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/types/MapperType.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/types/MapperType.java new file mode 100644 index 000000000..5b0df32af --- /dev/null +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/types/MapperType.java @@ -0,0 +1,44 @@ +/* + * 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.txt file. + */ +package org.apache.tools.ant.types; + +import java.util.Properties; + +/** + * Class as Argument to FileNameMapper.setType. + */ +public class MapperType + extends EnumeratedAttribute +{ + private final Properties m_implementations; + + public MapperType() + { + m_implementations = new Properties(); + m_implementations.put( "identity", + "org.apache.tools.ant.util.IdentityMapper" ); + m_implementations.put( "flatten", + "org.apache.tools.ant.util.FlatFileNameMapper" ); + m_implementations.put( "glob", + "org.apache.tools.ant.util.GlobPatternMapper" ); + m_implementations.put( "merge", + "org.apache.tools.ant.util.MergingMapper" ); + m_implementations.put( "regexp", + "org.apache.tools.ant.util.RegexpPatternMapper" ); + } + + public String getImplementation() + { + return m_implementations.getProperty( getValue() ); + } + + public String[] getValues() + { + return new String[]{"identity", "flatten", "glob", "merge", "regexp"}; + } +}