| 
xelem.3.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.fountain.xelem.XFactory
public class XFactory
An intermediary to the configuration file, it's main productline being 
 SpreadsheetML Style elements. An instance of this class may be obtained by calling
 the newInstance()-method. 
 
 Normally this class expects a configuration file at the location
 config/xelem.xml, relative to the classloader of the 
 main application. If desired a different location may be set by calling
 setConfigurationFileName(String) prior to obtaining a new instance.
 
 At the first call to newInstance() the XFactory parses the
 configuration file and loads comments and styles from it. The XFactory
 can be used to merge styles.
| Method Summary | |
|---|---|
 boolean | 
addStyle(Element style)
Add a new SpreadsheetML Style element to the factory.  | 
 void | 
appendInfoSheet(Element root,
                GIO gio)
Appends a Worksheet element with general information to the root element.  | 
static XFactory | 
emptyFactory()
Gets a new empty instance of this class; all existing instances of this class will be empty after calling this method.  | 
static String | 
getConfigurationFileName()
Gets the file name of the configuration file.  | 
 List<String> | 
getDocComments()
Gets a list of Strings which represent the node values of the tag <f:comment> in the configuration file. | 
 Element | 
getStyle(String id)
Gets the SpreadsheetML Style element with the ss:StyleID id. | 
 Set<String> | 
getStyleIDs()
Gets a set of ss:ID's (String) of all the available styles in the factory.  | 
 int | 
getStylesCount()
Gets the number of available styles in the factory.  | 
 void | 
mergeStyles(String newID,
            String id1,
            String id2)
Merges two SpreadsheetML Style elements.  | 
static XFactory | 
newInstance()
Gets an instance of this class.  | 
static void | 
reset()
Resets the static configuration and configuration file name.  | 
static void | 
setConfigurationFileName(String fileName)
Sets path and file name of the configuration file.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static XFactory newInstance()
                            throws XelemException
XelemException - could be caused by:
 public static XFactory emptyFactory()
public static void setConfigurationFileName(String fileName)
config/xelem.xml. The file name must be absolute or
 relative to the classloader of the main application.
fileName - The file name (may include path) of the configuration file.public static String getConfigurationFileName()
config/xelem.xml.
public static void reset()
config/xelem.xml will be reflected in a new instance.
public List<String> getDocComments()
<f:comment> in the configuration file. 
 If no comments are present the list may be empty.
public Element getStyle(String id)
id.
 The Style element was either present in the configuration file or was
 previously merged with the method 
 mergeStyles.
id - The ss:ID attribute-value of the wanted style.
null if the wanted style
                        is unknown to the factory.public int getStylesCount()
public Set<String> getStyleIDs()
public void mergeStyles(String newID,
                        String id1,
                        String id2)
                 throws UnsupportedStyleException
newID allready was present in the factory, nothing happens.
 newID
 and is from now on availlable by the method 
 getStyle(newID).
newID - the ss:ID of the new merged styleid1 - the ss:ID of the copied styleid2 - the ss:ID of the appended style
UnsupportedStyleException - if either of the styles mentioned with 
                        id1 or id2 are unknown to the factory.public boolean addStyle(Element style)
false.
style - a SpreadsheetML style element
true if the style element was succesfully added,
        false otherwise
NullPointerException - if the passed style did not
        have an attribute ss:ID
public void appendInfoSheet(Element root,
                            GIO gio)
                     throws XelemException
root - the root element.gio - the GIO used while assembling the Workbook.
XelemException - if the info sheet could not be loaded.Workbook.appendInfoSheet()
  | 
xelem.3.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||