Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.clearcase

public Class CCMkattr

extends ClearCase
Class Inheritance
Imports
org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.Execute, org.apache.tools.ant.taskdefs.condition.Os, org.apache.tools.ant.types.Commandline

Task to perform mkattr command to ClearCase.

The following attributes are interpreted:

Task attributes
Attribute Values Required
viewpath Path to the ClearCase view file or directory that the command will operate on Yes
replace Replace the value of the attribute if it already exists No
recurse Process each subdirectory under viewpath No
version Identify a specific version to attach the attribute to No
typename Name of the attribute type Yes
typevalue Value to attach to the attribute type Yes
comment Specify a comment. Only one of comment or cfile may be used. No
commentfile Specify a file containing a comment. Only one of comment or cfile may be used. No
failonerr Throw an exception if the command fails. Default is true No

Field Summary

Modifier and TypeField and Description
public static final String
FLAG_COMMENT

-c flag -- comment to attach to the element

public static final String
FLAG_COMMENTFILE

-cfile flag -- file containing a comment to attach to the file

public static final String
FLAG_NOCOMMENT

-nc flag -- no comment is specified

public static final String
FLAG_RECURSE

-recurse flag -- process all subdirectories

public static final String
FLAG_REPLACE

-replace flag -- replace the existing value of the attribute

public static final String
FLAG_VERSION

-version flag -- attach attribute to specified version

private String
private String
private boolean
private boolean
private String
private String
private String
Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
COMMAND_CHECKINCOMMAND_CHECKOUTCOMMAND_LOCKCOMMAND_LSCOCOMMAND_MKATTRCOMMAND_MKBLCOMMAND_MKDIRCOMMAND_MKELEMCOMMAND_MKLABELCOMMAND_MKLBTYPECOMMAND_RMTYPECOMMAND_UNCHECKOUTCOMMAND_UNLOCKCOMMAND_UPDATE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkOptions(Commandline cmd)

Check the command line options.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Executes the task.
public String

Returns:

String containing the comment
getComment
()

Get comment string

private void
getCommentCommand(Commandline
containing the command line string with or without the comment flag and string appended
cmd
)

Get the 'comment' command

public String

Returns:

String containing the path to the comment file
getCommentFile
()

Get comment file

private void
getCommentFileCommand(Commandline
containing the command line string with or without the commentfile flag and file appended
cmd
)

Get the 'commentfile' command

public boolean

Returns:

boolean containing status of recurse flag
getRecurse
()

Get recurse flag status

public boolean

Returns:

boolean containing status of replace flag
getReplace
()

Get replace flag status

private void
getTypeCommand(Commandline
containing the command line string with or without the type-name
cmd
)

Get the attribute type-name

public String

Returns:

String containing type name
getTypeName
()

Get attribute type-name

public String

Returns:

String containing type value
getTypeValue
()

Get the attribute type-value

private void
getTypeValueCommand(Commandline
containing the command line string with or without the type-value
cmd
)

Get the attribute type-value

public String

Returns:

boolean containing status of version flag
getVersion
()

Get version flag status

private void
getVersionCommand(Commandline
CommandLine containing the command line string with or without the version flag and string appended
cmd
)

Get the 'version' command

public void
setComment(String
the comment string
comment
)

Set comment string

public void
setCommentFile(String
the path to the comment file
cfile
)

Set comment file

public void
setRecurse(boolean
the status to set the flag to
recurse
)

Set recurse flag

public void
setReplace(boolean
the status to set the flag to
replace
)

Set the replace flag

public void
setTypeName(String
the type name
tn
)

Set the attribute type-name

public void
setTypeValue(String
the type value
tv
)

Set the attribute type-value

public void
setVersion(String
the status to set the flag to
version
)

Set the version flag

Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
getClearToolCommandgetFailOnErrgetObjSelectgetViewPathgetViewPathBasenamerunrunSrunSsetClearToolDirsetFailOnErrsetObjSelectsetViewPath

Field Detail

FLAG_COMMENTback to summary
public static final String FLAG_COMMENT

-c flag -- comment to attach to the element

FLAG_COMMENTFILEback to summary
public static final String FLAG_COMMENTFILE

-cfile flag -- file containing a comment to attach to the file

FLAG_NOCOMMENTback to summary
public static final String FLAG_NOCOMMENT

-nc flag -- no comment is specified

FLAG_RECURSEback to summary
public static final String FLAG_RECURSE

-recurse flag -- process all subdirectories

FLAG_REPLACEback to summary
public static final String FLAG_REPLACE

-replace flag -- replace the existing value of the attribute

FLAG_VERSIONback to summary
public static final String FLAG_VERSION

-version flag -- attach attribute to specified version

mCfileback to summary
private String mCfile
mCommentback to summary
private String mComment
mRecurseback to summary
private boolean mRecurse
mReplaceback to summary
private boolean mReplace
mTypeNameback to summary
private String mTypeName
mTypeValueback to summary
private String mTypeValue
mVersionback to summary
private String mVersion

Constructor Detail

CCMkattrback to summary
public CCMkattr()

Method Detail

checkOptionsback to summary
private void checkOptions(Commandline cmd)

Check the command line options.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Executes the task.

Builds a command line to execute cleartool and then calls Exec's run method to execute the command line.

Annotations
@Override
Exceptions
BuildException:
if the command fails and failonerr is set to true
getCommentback to summary
public String getComment()

Get comment string

Returns:String

String containing the comment

getCommentCommandback to summary
private void getCommentCommand(Commandline cmd)

Get the 'comment' command

Parameters
cmd:Commandline

containing the command line string with or without the comment flag and string appended

getCommentFileback to summary
public String getCommentFile()

Get comment file

Returns:String

String containing the path to the comment file

getCommentFileCommandback to summary
private void getCommentFileCommand(Commandline cmd)

Get the 'commentfile' command

Parameters
cmd:Commandline

containing the command line string with or without the commentfile flag and file appended

getRecurseback to summary
public boolean getRecurse()

Get recurse flag status

Returns:boolean

boolean containing status of recurse flag

getReplaceback to summary
public boolean getReplace()

Get replace flag status

Returns:boolean

boolean containing status of replace flag

getTypeCommandback to summary
private void getTypeCommand(Commandline cmd)

Get the attribute type-name

Parameters
cmd:Commandline

containing the command line string with or without the type-name

getTypeNameback to summary
public String getTypeName()

Get attribute type-name

Returns:String

String containing type name

getTypeValueback to summary
public String getTypeValue()

Get the attribute type-value

Returns:String

String containing type value

getTypeValueCommandback to summary
private void getTypeValueCommand(Commandline cmd)

Get the attribute type-value

Parameters
cmd:Commandline

containing the command line string with or without the type-value

getVersionback to summary
public String getVersion()

Get version flag status

Returns:String

boolean containing status of version flag

getVersionCommandback to summary
private void getVersionCommand(Commandline cmd)

Get the 'version' command

Parameters
cmd:Commandline

CommandLine containing the command line string with or without the version flag and string appended

setCommentback to summary
public void setComment(String comment)

Set comment string

Parameters
comment:String

the comment string

setCommentFileback to summary
public void setCommentFile(String cfile)

Set comment file

Parameters
cfile:String

the path to the comment file

setRecurseback to summary
public void setRecurse(boolean recurse)

Set recurse flag

Parameters
recurse:boolean

the status to set the flag to

setReplaceback to summary
public void setReplace(boolean replace)

Set the replace flag

Parameters
replace:boolean

the status to set the flag to

setTypeNameback to summary
public void setTypeName(String tn)

Set the attribute type-name

Parameters
tn:String

the type name

setTypeValueback to summary
public void setTypeValue(String tv)

Set the attribute type-value

Parameters
tv:String

the type value

setVersionback to summary
public void setVersion(String version)

Set the version flag

Parameters
version:String

the status to set the flag to