From 3d6bdcae698a7335106d51c59174c6b3f2f1bfdd Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Thu, 6 Jul 2006 23:27:57 +0000 Subject: [PATCH] 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 --- .../commons/lang/text/VariableFormatter.java | 111 +++++++++--------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/src/java/org/apache/commons/lang/text/VariableFormatter.java b/src/java/org/apache/commons/lang/text/VariableFormatter.java index 6745115f1..aba5125d3 100644 --- a/src/java/org/apache/commons/lang/text/VariableFormatter.java +++ b/src/java/org/apache/commons/lang/text/VariableFormatter.java @@ -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 null */ - 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 null + */ + 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 null - */ - public void setVariableSuffix(String variableSuffix) throws IllegalArgumentException { - if (variableSuffix == null) { - throw new IllegalArgumentException("Variable suffix must not be null!"); - } - this.variableSuffix = variableSuffix; - } }