Package org.apache.fop.fo.properties
Class CommonHyphenation
- java.lang.Object
-
- org.apache.fop.fo.properties.CommonHyphenation
-
public final class CommonHyphenation extends java.lang.Object
Store all common hyphenation properties. See Sec. 7.9 of the XSL-FO Standard. Public "structure" allows direct member access.
-
-
Field Summary
Fields Modifier and Type Field Description private static PropertyCache<CommonHyphenation>
CACHE
StringProperty
country
The "country" propertyprivate int
hash
private static char
HYPHEN_MINUS
EnumProperty
hyphenate
The "hyphenate" propertyOptionalCharacterProperty
hyphenationCharacter
The "hyphenation-character" propertyNumberProperty
hyphenationPushCharacterCount
The "hyphenation-push-character-count" propertyNumberProperty
hyphenationRemainCharacterCount
The "hyphenation-remain-character-count" propertyStringProperty
language
The "language" propertyprivate static org.apache.commons.logging.Log
LOG
Loggerprivate static char
MINUS_SIGN
StringProperty
script
The "script" property
-
Constructor Summary
Constructors Modifier Constructor Description private
CommonHyphenation(StringProperty language, StringProperty country, StringProperty script, EnumProperty hyphenate, OptionalCharacterProperty hyphenationCharacter, NumberProperty hyphenationPushCharacterCount, NumberProperty hyphenationRemainCharacterCount)
Construct a CommonHyphenation object holding the given properties
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Character
getHyphChar(Font font)
Returns the effective hyphenation character for a font.int
getHyphIPD(Font font)
Returns the IPD for the hyphenation character for a font.static CommonHyphenation
getInstance(PropertyList propertyList)
Gets the canonicalCommonHyphenation
instance corresponding to the values of the related properties present on the givenPropertyList
java.util.Locale
getLocale()
Creates and returns aLocale
representation of the language and country.int
hashCode()
private static boolean
isDefined(java.lang.String property)
static java.util.Locale
toLocale(java.lang.String language, java.lang.String country)
Creates and returns aLocale
representation of the given language, and the given country if set.
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
Logger
-
CACHE
private static final PropertyCache<CommonHyphenation> CACHE
-
hash
private int hash
-
language
public final StringProperty language
The "language" property
-
country
public final StringProperty country
The "country" property
-
script
public final StringProperty script
The "script" property
-
hyphenate
public final EnumProperty hyphenate
The "hyphenate" property
-
hyphenationCharacter
public final OptionalCharacterProperty hyphenationCharacter
The "hyphenation-character" property
-
hyphenationPushCharacterCount
public final NumberProperty hyphenationPushCharacterCount
The "hyphenation-push-character-count" property
-
hyphenationRemainCharacterCount
public final NumberProperty hyphenationRemainCharacterCount
The "hyphenation-remain-character-count" property
-
HYPHEN_MINUS
private static final char HYPHEN_MINUS
- See Also:
- Constant Field Values
-
MINUS_SIGN
private static final char MINUS_SIGN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CommonHyphenation
private CommonHyphenation(StringProperty language, StringProperty country, StringProperty script, EnumProperty hyphenate, OptionalCharacterProperty hyphenationCharacter, NumberProperty hyphenationPushCharacterCount, NumberProperty hyphenationRemainCharacterCount)
Construct a CommonHyphenation object holding the given properties
-
-
Method Detail
-
getInstance
public static CommonHyphenation getInstance(PropertyList propertyList) throws PropertyException
Gets the canonicalCommonHyphenation
instance corresponding to the values of the related properties present on the givenPropertyList
- Parameters:
propertyList
- thePropertyList
- Returns:
- a common hyphenation instance
- Throws:
PropertyException
- if a a property exception occurs
-
getHyphChar
public java.lang.Character getHyphChar(Font font)
Returns the effective hyphenation character for a font. The hyphenation character specified in XSL-FO may be substituted if it's not available in the font.- Parameters:
font
- the font- Returns:
- the effective hyphenation character.
-
getHyphIPD
public int getHyphIPD(Font font)
Returns the IPD for the hyphenation character for a font.- Parameters:
font
- the font- Returns:
- the IPD in millipoints for the hyphenation character.
-
getLocale
public java.util.Locale getLocale()
Creates and returns aLocale
representation of the language and country.- Returns:
- the language (and the country if set) represented as a locale,
null
if the language has not been set (i.e., has been left to its initial value of "none")
-
toLocale
public static java.util.Locale toLocale(java.lang.String language, java.lang.String country)
Creates and returns aLocale
representation of the given language, and the given country if set. The country is considered to be set if notnull
and not set to "none".- Returns:
- the language and country represented as a locale,
null
if the language is null or "none" (case insensitive)
-
isDefined
private static boolean isDefined(java.lang.String property)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-