git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271343 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -147,17 +147,6 @@ public class Commandline | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * Return a marker. <p> | |||||
| * | |||||
| * This marker can be used to locate a position on the commandline - to | |||||
| * insert something for example - when all parameters have been set.</p> | |||||
| */ | |||||
| // public Marker createMarker() | |||||
| // { | |||||
| // return new Marker( this, m_arguments.size() ); | |||||
| // } | |||||
| public int size() | public int size() | ||||
| { | { | ||||
| return getCommandline().length; | return getCommandline().length; | ||||
| @@ -1,53 +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.tools.ant.types; | |||||
| import java.util.ArrayList; | |||||
| /** | |||||
| * Class to keep track of the position of an Argument. | |||||
| * | |||||
| * <p>This class is there to support the srcfile and targetfile | |||||
| * elements of <execon> and <transform> - don't know | |||||
| * whether there might be additional use cases.</p> --SB | |||||
| */ | |||||
| public class Marker | |||||
| { | |||||
| private int m_realPos = -1; | |||||
| private int m_position; | |||||
| private Commandline m_commandline; | |||||
| Marker( Commandline commandline, int position ) | |||||
| { | |||||
| m_commandline = commandline; | |||||
| m_position = position; | |||||
| } | |||||
| /** | |||||
| * Return the number of arguments that preceeded this marker. <p> | |||||
| * | |||||
| * The name of the executable - if set - is counted as the very first | |||||
| * argument.</p> | |||||
| * | |||||
| * @return The Position value | |||||
| */ | |||||
| public int getPosition() | |||||
| { | |||||
| if( m_realPos == -1 ) | |||||
| { | |||||
| m_realPos = ( m_commandline.getExecutable() == null ? 0 : 1 ); | |||||
| final ArrayList arguments = m_commandline.m_arguments; | |||||
| for( int i = 0; i < m_position; i++ ) | |||||
| { | |||||
| final Argument arg = (Argument)arguments.get( i ); | |||||
| m_realPos += arg.getParts().length; | |||||
| } | |||||
| } | |||||
| return m_realPos; | |||||
| } | |||||
| } | |||||
| @@ -147,17 +147,6 @@ public class Commandline | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * Return a marker. <p> | |||||
| * | |||||
| * This marker can be used to locate a position on the commandline - to | |||||
| * insert something for example - when all parameters have been set.</p> | |||||
| */ | |||||
| // public Marker createMarker() | |||||
| // { | |||||
| // return new Marker( this, m_arguments.size() ); | |||||
| // } | |||||
| public int size() | public int size() | ||||
| { | { | ||||
| return getCommandline().length; | return getCommandline().length; | ||||
| @@ -1,53 +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.tools.ant.types; | |||||
| import java.util.ArrayList; | |||||
| /** | |||||
| * Class to keep track of the position of an Argument. | |||||
| * | |||||
| * <p>This class is there to support the srcfile and targetfile | |||||
| * elements of <execon> and <transform> - don't know | |||||
| * whether there might be additional use cases.</p> --SB | |||||
| */ | |||||
| public class Marker | |||||
| { | |||||
| private int m_realPos = -1; | |||||
| private int m_position; | |||||
| private Commandline m_commandline; | |||||
| Marker( Commandline commandline, int position ) | |||||
| { | |||||
| m_commandline = commandline; | |||||
| m_position = position; | |||||
| } | |||||
| /** | |||||
| * Return the number of arguments that preceeded this marker. <p> | |||||
| * | |||||
| * The name of the executable - if set - is counted as the very first | |||||
| * argument.</p> | |||||
| * | |||||
| * @return The Position value | |||||
| */ | |||||
| public int getPosition() | |||||
| { | |||||
| if( m_realPos == -1 ) | |||||
| { | |||||
| m_realPos = ( m_commandline.getExecutable() == null ? 0 : 1 ); | |||||
| final ArrayList arguments = m_commandline.m_arguments; | |||||
| for( int i = 0; i < m_position; i++ ) | |||||
| { | |||||
| final Argument arg = (Argument)arguments.get( i ); | |||||
| m_realPos += arg.getParts().length; | |||||
| } | |||||
| } | |||||
| return m_realPos; | |||||
| } | |||||
| } | |||||