|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Builder<T>
Interface for parsing perforce output into a concrete object and also for saving the object back to perforce.
The pattern for using this template to build an object is:
#getBuildCmd(String)build(StringBuilder)And conversely for saving:
Builder#getSaveCmd(Object)save(Object, Writer)
| Method Summary | |
|---|---|
T |
build(java.lang.StringBuilder sb)
This should assemble an object from a string value. |
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,
T obj)
The converse of #getBuildCmd(String) this should return the command line tokens to execute for saving an
object to Perforce. |
boolean |
requiresStandardInput()
Tells the AbstractPerforceTemplate whether or not this builder will write data on Standard Input to the perforce command specified in getSaveCmd(). |
void |
save(T obj,
java.io.Writer writer)
The converse of build(StringBuilder) this should take an object and disassemble it for writing to the
Perforce server. |
| Method Detail |
|---|
java.lang.String[] getBuildCmd(java.lang.String p4exe,
java.lang.String id)
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.
T build(java.lang.StringBuilder sb)
throws PerforceException
sb - The StringBuilder containing the string value.
PerforceException - If the format is invalid or other errors occur.
java.lang.String[] getSaveCmd(java.lang.String p4exe,
T obj)
#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.
boolean requiresStandardInput()
void save(T obj,
java.io.Writer writer)
throws PerforceException
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.
obj - The object to be savedwriter - The Writer to write the string representation to
PerforceException - If the object is invalid or there is an issue with writing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||