Layout getters and setters in pairs to match general lang formatting

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@419738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2006-07-06 23:27:57 +00:00
parent 6aa020e6bc
commit 3d6bdcae69
1 changed files with 57 additions and 54 deletions

View File

@ -737,46 +737,10 @@ public class VariableFormatter {
return doReplace(data, 0, data.length, obj, priorVariables);
}
/**
* Returns the escape character.
*
* @return the character used for escaping variable references
*/
public char getEscapeCharacter() {
return this.escapeCharacter;
}
private int getLength(FieldPosition tok) {
return tok.getEndIndex() - tok.getBeginIndex();
}
/**
* Returns the prefix for variables.
*
* @return the prefix for variables
*/
public String getVariablePrefix() {
return this.variablePrefix;
}
/**
* Gets the VariableResolver
*
* @return the VariableResolver
*/
public VariableResolver getVariableResolver() {
return this.variableResolver;
}
/**
* Returns the suffix for variables.
*
* @return the suffix for variables
*/
public String getVariableSuffix() {
return this.variableSuffix;
}
/**
* Replaces the occurrences of all variables in the given source array by their current values.
*
@ -850,9 +814,20 @@ public class VariableFormatter {
return this.getVariableResolver().resolveVariable(name);
}
//-----------------------------------------------------------------------
/**
* Sets the escape character. If this character is placed before a variable reference in the source text, this
* variable will be ignored.
* Returns the escape character.
*
* @return the character used for escaping variable references
*/
public char getEscapeCharacter() {
return this.escapeCharacter;
}
/**
* Sets the escape character.
* If this character is placed before a variable reference in the source
* text, this variable will be ignored.
*
* @param escapeCharacter
* the escape character (0 for disabling escaping)
@ -861,21 +836,63 @@ public class VariableFormatter {
this.escapeCharacter = escapeCharacter;
}
/**
* Returns the prefix for variables.
*
* @return the prefix for variables
*/
public String getVariablePrefix() {
return this.variablePrefix;
}
/**
* Sets the prefix for variables.
*
* @param variablePrefix
* the prefix for variables
* the prefix for variables, not null
* @throws IllegalArgumentException
* if the prefix is <b>null</b>
*/
public void setVariablePrefix(String variablePrefix) throws IllegalArgumentException {
public void setVariablePrefix(String variablePrefix) {
if (variablePrefix == null) {
throw new IllegalArgumentException("Variable prefix must not be null!");
}
this.variablePrefix = variablePrefix;
}
/**
* Returns the suffix for variables.
*
* @return the suffix for variables
*/
public String getVariableSuffix() {
return this.variableSuffix;
}
/**
* Sets the suffix for variables
*
* @param variableSuffix
* the suffix for variables, not null
* @throws IllegalArgumentException
* if the prefix is <b>null</b>
*/
public void setVariableSuffix(String variableSuffix) {
if (variableSuffix == null) {
throw new IllegalArgumentException("Variable suffix must not be null!");
}
this.variableSuffix = variableSuffix;
}
/**
* Gets the VariableResolver
*
* @return the VariableResolver
*/
public VariableResolver getVariableResolver() {
return this.variableResolver;
}
/**
* Sets the VariableResolver
*
@ -886,18 +903,4 @@ public class VariableFormatter {
this.variableResolver = variableResolver;
}
/**
* Sets the suffix for variables
*
* @param variableSuffix
* the suffix for variables
* @throws IllegalArgumentException
* if the prefix is <b>null</b>
*/
public void setVariableSuffix(String variableSuffix) throws IllegalArgumentException {
if (variableSuffix == null) {
throw new IllegalArgumentException("Variable suffix must not be null!");
}
this.variableSuffix = variableSuffix;
}
}