com.tek42.perforce.parse
Class LabelBuilder

java.lang.Object
  extended by com.tek42.perforce.parse.AbstractFormBuilder<Label>
      extended by com.tek42.perforce.parse.LabelBuilder
All Implemented Interfaces:
Builder<Label>

public class LabelBuilder
extends AbstractFormBuilder<Label>

Responsible for building and saving labels.

Author:
Mike Wille

Constructor Summary
LabelBuilder()
           
 
Method Summary
 Label buildForm(java.util.Map<java.lang.String,java.lang.String> fields)
          Should return a new object set with the data from fields.
 java.lang.String[] getBuildCmd(java.lang.String p4exe, java.lang.String id)
          This should return the command line tokens to execute for retrieving an object from Perforce.
 java.lang.String[] getSaveCmd(java.lang.String p4exe, Label obj)
          The converse of #getBuildCmd(String) this should return the command line tokens to execute for saving an object to Perforce.
 void save(Label label, java.io.Writer writer)
          The converse of Builder.build(StringBuilder) this should take an object and disassemble it for writing to the Perforce server.
 
Methods inherited from class com.tek42.perforce.parse.AbstractFormBuilder
build, getField, getFieldAsList, requiresStandardInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelBuilder

public LabelBuilder()
Method Detail

buildForm

public Label buildForm(java.util.Map<java.lang.String,java.lang.String> fields)
                throws PerforceException
Description copied from class: AbstractFormBuilder
Should return a new object set with the data from fields.

Specified by:
buildForm in class AbstractFormBuilder<Label>
Returns:
Throws:
PerforceException

getBuildCmd

public java.lang.String[] getBuildCmd(java.lang.String p4exe,
                                      java.lang.String id)
Description copied from interface: Builder
This should return the command line tokens to execute for retrieving an object from Perforce. For example: String[] { "p4", "user", "-o", "mwille" }

id - The ID or Name of the object we are working on. In the case of a changelist, the changelist number. In the case of a user, the username.
Returns:
A 1D string array of tokens to execute.

getSaveCmd

public java.lang.String[] getSaveCmd(java.lang.String p4exe,
                                     Label obj)
Description copied from interface: Builder
The converse of #getBuildCmd(String) this should return the command line tokens to execute for saving an object to Perforce. For example: String[] { "p4", "user", "-i", "mwille" }

Note, although the object being saved is passed to this method, this method does not need to do anything with it.

obj - The object that is being saved, useful if propert(ies) are needed for the save command to be generated.
Returns:
A 1D string array of tokens to execute

save

public void save(Label label,
                 java.io.Writer writer)
          throws PerforceException
Description copied from interface: Builder
The converse of Builder.build(StringBuilder) this should take an object and disassemble it for writing to the Perforce server. The specification of what is written to the Writer is dependant on the object being saved.

Parameters:
label - The object to be saved
writer - The Writer to write the string representation to
Throws:
PerforceException - If the object is invalid or there is an issue with writing


Copyright © 2010. All Rights Reserved.