com.xmlmind.fo.converter
Class UserStyles

java.lang.Object
  extended by com.xmlmind.fo.converter.UserStyles

public final class UserStyles
extends Object

A set of user styles to be used during a conversion.

A set of user styles is an opaque, immutable hence thread-safe, object, which is loaded from an XML file conforming to the styles.xsd schema using any of the loadFrom static methods.

See Also:
Converter.setProperty(java.lang.String, java.lang.String), Converter.setUserStyles(com.xmlmind.fo.converter.UserStyles), loadFrom(File), loadFrom(URL), loadFrom(InputStream, String)

Field Summary
 com.xmlmind.fo.converter.UserNumbering[] numberingList
          Not part of the public, documented, API: The sorted (by name) list of numberings which are parts of this set.
 Hashtable numberings
          Not part of the public, documented, API: For all numberings which are parts of this set, Maps the numbering name to the corresponding numbering object.
 com.xmlmind.fo.converter.UserParagraphStyle[] paragraphStyleList
          Not part of the public, documented, API: The sorted (base styles first, then sorted by name) list of paragraph styles which are parts of this set.
 Hashtable paragraphStyles
          Not part of the public, documented, API: For all paragraphs styles which are parts of this set, maps the paragraph style name to the corresponding paragraph style object.
 com.xmlmind.fo.converter.UserTextStyle[] textStyleList
          Not part of the public, documented, API: The sorted (base styles first, then sorted by name) list of text styles which are parts of this set.
 Hashtable textStyles
          Not part of the public, documented, API: For all text styles which are parts of this set, maps the text style name to the corresponding text style object.
 
Constructor Summary
UserStyles(Hashtable textStyles, Hashtable numberings, Hashtable paragraphStyles)
          Not part of the public, documented, API: Constructs a set of user styles.
 
Method Summary
 void compileProperties(com.xmlmind.fo.converter.Context context)
          Not part of the public, documented, API: Compile the list of XSL-FO properties of each user styles which is part of this.
 UserStyles copy()
          Not part of the public, documented, API: Returns a deep copy of this set of user styles.
 int indexOfNumbering(com.xmlmind.fo.converter.UserNumbering numbering)
          Not part of the public, documented, API: Returns the index of specified numbering within numberingList.
 int indexOfParagraphStyle(com.xmlmind.fo.converter.UserParagraphStyle paragraphStyle)
          Not part of the public, documented, API: Returns the index of specified paragraph style within paragraphStyleList.
 int indexOfTextStyle(com.xmlmind.fo.converter.UserTextStyle textStyle)
          Not part of the public, documented, API: Returns the index of specified text style within textStyleList.
static UserStyles loadFrom(File file)
          Load a set of user styles from specified file.
static UserStyles loadFrom(InputStream in, String systemId)
          Load a set of user styles from specified input stream.
static UserStyles loadFrom(URL url)
          Load a set of user styles from specified file.
 String toString()
          Returns a string representation of this set of user styles which is suitable for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

textStyles

public final Hashtable textStyles
Not part of the public, documented, API: For all text styles which are parts of this set, maps the text style name to the corresponding text style object.


numberings

public final Hashtable numberings
Not part of the public, documented, API: For all numberings which are parts of this set, Maps the numbering name to the corresponding numbering object.


paragraphStyles

public final Hashtable paragraphStyles
Not part of the public, documented, API: For all paragraphs styles which are parts of this set, maps the paragraph style name to the corresponding paragraph style object.


textStyleList

public final com.xmlmind.fo.converter.UserTextStyle[] textStyleList
Not part of the public, documented, API: The sorted (base styles first, then sorted by name) list of text styles which are parts of this set.


numberingList

public final com.xmlmind.fo.converter.UserNumbering[] numberingList
Not part of the public, documented, API: The sorted (by name) list of numberings which are parts of this set.


paragraphStyleList

public final com.xmlmind.fo.converter.UserParagraphStyle[] paragraphStyleList
Not part of the public, documented, API: The sorted (base styles first, then sorted by name) list of paragraph styles which are parts of this set.

Constructor Detail

UserStyles

public UserStyles(Hashtable textStyles,
                  Hashtable numberings,
                  Hashtable paragraphStyles)
           throws Exception
Not part of the public, documented, API: Constructs a set of user styles.

Throws:
Exception
Method Detail

copy

public UserStyles copy()
Not part of the public, documented, API: Returns a deep copy of this set of user styles.


indexOfTextStyle

public int indexOfTextStyle(com.xmlmind.fo.converter.UserTextStyle textStyle)
Not part of the public, documented, API: Returns the index of specified text style within textStyleList.


indexOfNumbering

public int indexOfNumbering(com.xmlmind.fo.converter.UserNumbering numbering)
Not part of the public, documented, API: Returns the index of specified numbering within numberingList.


indexOfParagraphStyle

public int indexOfParagraphStyle(com.xmlmind.fo.converter.UserParagraphStyle paragraphStyle)
Not part of the public, documented, API: Returns the index of specified paragraph style within paragraphStyleList.


compileProperties

public void compileProperties(com.xmlmind.fo.converter.Context context)
                       throws SAXException
Not part of the public, documented, API: Compile the list of XSL-FO properties of each user styles which is part of this.

Throws:
SAXException

toString

public String toString()
Returns a string representation of this set of user styles which is suitable for debugging.

Overrides:
toString in class Object

loadFrom

public static UserStyles loadFrom(File file)
                           throws Exception
Load a set of user styles from specified file.

Parameters:
file - the filename of the input file
Returns:
loaded set of user styles
Throws:
Exception - if, for any reason, this methods fails to load the set of user styles

loadFrom

public static UserStyles loadFrom(URL url)
                           throws Exception
Load a set of user styles from specified file.

Parameters:
url - the URL of the input file
Returns:
loaded set of user styles
Throws:
Exception - if, for any reason, this methods fails to load the set of user styles

loadFrom

public static UserStyles loadFrom(InputStream in,
                                  String systemId)
                           throws Exception
Load a set of user styles from specified input stream.

Parameters:
in - the input stream
systemId - the string form of the URL of the input file. May be null.
Returns:
loaded set of user styles
Throws:
Exception - if, for any reason, this methods fails to load the set of user styles