Browse Source

Made attribute private

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270735 13f79535-47bb-0310-9956-ffa450edef68
remotes/1776816827838153613/tmp_25f451bd36ab3145e487fcb2cd5c62c571e5b602
Peter Donald 24 years ago
parent
commit
04a62a443e
2 changed files with 12 additions and 26 deletions
  1. +6
    -13
      proposal/myrmidon/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java
  2. +6
    -13
      proposal/myrmidon/src/todo/org/apache/tools/ant/types/EnumeratedAttribute.java

+ 6
- 13
proposal/myrmidon/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java View File

@@ -19,11 +19,7 @@ import org.apache.myrmidon.api.TaskException;
*/ */
public abstract class EnumeratedAttribute public abstract class EnumeratedAttribute
{ {
protected String value;

public EnumeratedAttribute()
{
}
private String m_value;


/** /**
* Invoked by {@link org.apache.tools.ant.IntrospectionHelper * Invoked by {@link org.apache.tools.ant.IntrospectionHelper
@@ -32,14 +28,14 @@ public abstract class EnumeratedAttribute
* @param value The new Value value * @param value The new Value value
* @exception TaskException Description of Exception * @exception TaskException Description of Exception
*/ */
public final void setValue( String value )
public final void setValue( final String value )
throws TaskException throws TaskException
{ {
if( !containsValue( value ) ) if( !containsValue( value ) )
{ {
throw new TaskException( value + " is not a legal value for this attribute" ); throw new TaskException( value + " is not a legal value for this attribute" );
} }
this.value = value;
this.m_value = value;
} }


/** /**
@@ -49,7 +45,7 @@ public abstract class EnumeratedAttribute
*/ */
public final String getValue() public final String getValue()
{ {
return value;
return m_value;
} }


/** /**
@@ -61,13 +57,10 @@ public abstract class EnumeratedAttribute


/** /**
* Is this value included in the enumeration? * Is this value included in the enumeration?
*
* @param value Description of Parameter
* @return Description of the Returned Value
*/ */
public final boolean containsValue( String value )
public final boolean containsValue( final String value )
{ {
String[] values = getValues();
final String[] values = getValues();
if( values == null || value == null ) if( values == null || value == null )
{ {
return false; return false;


+ 6
- 13
proposal/myrmidon/src/todo/org/apache/tools/ant/types/EnumeratedAttribute.java View File

@@ -19,11 +19,7 @@ import org.apache.myrmidon.api.TaskException;
*/ */
public abstract class EnumeratedAttribute public abstract class EnumeratedAttribute
{ {
protected String value;

public EnumeratedAttribute()
{
}
private String m_value;


/** /**
* Invoked by {@link org.apache.tools.ant.IntrospectionHelper * Invoked by {@link org.apache.tools.ant.IntrospectionHelper
@@ -32,14 +28,14 @@ public abstract class EnumeratedAttribute
* @param value The new Value value * @param value The new Value value
* @exception TaskException Description of Exception * @exception TaskException Description of Exception
*/ */
public final void setValue( String value )
public final void setValue( final String value )
throws TaskException throws TaskException
{ {
if( !containsValue( value ) ) if( !containsValue( value ) )
{ {
throw new TaskException( value + " is not a legal value for this attribute" ); throw new TaskException( value + " is not a legal value for this attribute" );
} }
this.value = value;
this.m_value = value;
} }


/** /**
@@ -49,7 +45,7 @@ public abstract class EnumeratedAttribute
*/ */
public final String getValue() public final String getValue()
{ {
return value;
return m_value;
} }


/** /**
@@ -61,13 +57,10 @@ public abstract class EnumeratedAttribute


/** /**
* Is this value included in the enumeration? * Is this value included in the enumeration?
*
* @param value Description of Parameter
* @return Description of the Returned Value
*/ */
public final boolean containsValue( String value )
public final boolean containsValue( final String value )
{ {
String[] values = getValues();
final String[] values = getValues();
if( values == null || value == null ) if( values == null || value == null )
{ {
return false; return false;


Loading…
Cancel
Save