diff --git a/src/org/daisy/dotify/api/formatter/TextProperties.java b/src/org/daisy/dotify/api/formatter/TextProperties.java index affe0b8..3946541 100644 --- a/src/org/daisy/dotify/api/formatter/TextProperties.java +++ b/src/org/daisy/dotify/api/formatter/TextProperties.java @@ -18,7 +18,8 @@ public class TextProperties { private final String locale; private final String translationMode; private final boolean hyphenate; - + private final boolean markCapitalLetters; + /** * Provides a builder for creating text properties instances. * @@ -28,6 +29,7 @@ public static class Builder { private final String locale; private String translationMode = null; private boolean hyphenate = true; + private boolean markCapitalLetters = true; /** * Creates a new builder with the specified locale @@ -46,7 +48,17 @@ public Builder hyphenate(boolean value) { this.hyphenate = value; return this; } - + + /** + * Sets the markCapitalLetters value for this builder + * @param value the value + * @return returns this object + */ + public Builder markCapitalLetters(boolean value) { + this.markCapitalLetters = value; + return this; + } + /** * Sets the translation mode for the builder * @param mode the translation mode @@ -70,6 +82,7 @@ private TextProperties(Builder builder) { this.locale = builder.locale; this.translationMode = builder.translationMode; this.hyphenate = builder.hyphenate; + this.markCapitalLetters = builder.markCapitalLetters; } /** @@ -96,11 +109,21 @@ public boolean isHyphenating() { return hyphenate; } + /** + * Returns true if the mark capital letters property is true, false otherwise + * @return returns true if the mark capital letters property is true + */ + public boolean shouldMarkCapitalLetters() { + return markCapitalLetters; + } + + @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (hyphenate ? 1231 : 1237); + result = prime * result + (markCapitalLetters ? 1241 : 1247); result = prime * result + ((locale == null) ? 0 : locale.hashCode()); result = prime * result + ((translationMode == null) ? 0 : translationMode.hashCode()); return result; @@ -121,6 +144,9 @@ public boolean equals(Object obj) { if (hyphenate != other.hyphenate) { return false; } + if (markCapitalLetters != other.markCapitalLetters) { + return false; + } if (locale == null) { if (other.locale != null) { return false;