diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java index c31a2f963..79cc75193 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/ConverterDefinition.java @@ -15,23 +15,16 @@ package org.apache.myrmidon.interfaces.deployer; public class ConverterDefinition extends TypeDefinition { - private String m_sourceType; - private String m_destinationType; + private final String m_sourceType; + private final String m_destinationType; - /** - * Returns the type's role. - */ - public String getRoleShorthand() + public ConverterDefinition( final String className, + final String sourceType, + final String destinationType ) { - return "converter"; - } - - /** - * Returns the type's name. - */ - public String getName() - { - return getClassname(); + super( className, "converter", className ); + m_sourceType = sourceType; + m_destinationType = destinationType; } /** @@ -42,14 +35,6 @@ public class ConverterDefinition return m_sourceType; } - /** - * Sets the converter's source type. - */ - public void setSourceType( final String sourceType ) - { - m_sourceType = sourceType; - } - /** * Returns the converter's destination type. */ @@ -57,12 +42,4 @@ public class ConverterDefinition { return m_destinationType; } - - /** - * Sets the converter's destination type. - */ - public void setDestinationType( final String destinationType ) - { - m_destinationType = destinationType; - } } diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/GeneralTypeDefinition.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/GeneralTypeDefinition.java deleted file mode 100644 index 88d3be70a..000000000 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/GeneralTypeDefinition.java +++ /dev/null @@ -1,52 +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.txt file. - */ -package org.apache.myrmidon.interfaces.deployer; - -/** - * A general-purpose type definition. - * - * @author Adam Murdoch - */ -public class GeneralTypeDefinition - extends TypeDefinition -{ - private String m_name; - private String m_roleShorthand; - - /** - * Returns the type's role. - */ - public String getRoleShorthand() - { - return m_roleShorthand; - } - - /** - * Sets the type's role. - */ - public void setType( String roleShorthand ) - { - m_roleShorthand = roleShorthand; - } - - /** - * Returns the type's name. - */ - public String getName() - { - return m_name; - } - - /** - * Sets the type's name. - */ - public void setName( String name ) - { - m_name = name; - } -} diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java index 9f2cec902..de7a055a9 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/deployer/TypeDefinition.java @@ -8,38 +8,46 @@ package org.apache.myrmidon.interfaces.deployer; /** - * A basic type definition. This class is used to build a type definition, - * from a typelib descriptor, or via introspection. + * A general-purpose type definition. * * @author Adam Murdoch */ -public abstract class TypeDefinition +public class TypeDefinition { - private String m_className; + private final String m_name; + private final String m_role; + private final String m_classname; - /** - * Returns the type's name. - */ - public abstract String getName(); + public TypeDefinition( final String name, + final String roleShorthand, + final String className ) + { + m_name = name; + m_role = roleShorthand; + m_classname = className; + } /** - * Returns the type's role. + * Returns the type's implementation class name. */ - public abstract String getRoleShorthand(); + public final String getClassname() + { + return m_classname; + } /** - * Returns the type's implementation class name. + * Returns the type's role. */ - public String getClassname() + public final String getRole() { - return m_className; + return m_role; } /** - * Sets the type's implementation class name. + * Returns the type's name. */ - public void setClassname( final String className ) + public String getName() { - m_className = className; + return m_name; } }