org.jopendocument.dom
Class Library

java.lang.Object
  extended by org.jopendocument.dom.Library
Direct Known Subclasses:
Library.EmbeddedLibrary, Library.LinkedLibrary

public abstract class Library
extends java.lang.Object

A BASIC script library.

Author:
Sylvain

Nested Class Summary
static class Library.EmbeddedLibrary
           
static class Library.LinkedLibrary
           
 
Field Summary
static java.lang.String DIALOG_DIR_NAME
           
static java.lang.String DIALOG_LIBRARY_LIST_FILENAME
           
static java.lang.String DIALOG_LIST_FILENAME
           
static java.lang.String DIR_NAME
           
static java.lang.String LIBRARY_LIST_FILENAME
           
static java.lang.String MODULE_LIST_FILENAME
           
 
Method Summary
abstract  boolean canBeMerged(Library other)
          Whether this library can be merged with the passed one.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 int hashCode()
           
 boolean isReadonly()
           
static boolean removeFromPackage(ODPackage pkg, java.lang.String libName)
           
abstract  org.jdom.Element toFlatXML(XMLFormatVersion vers)
          The element to define this in a flat XML.
abstract  java.util.Map<java.lang.String,org.jdom.Document> toPackageDialogDocuments(XMLFormatVersion vers)
           
abstract  java.util.Map<java.lang.String,org.jdom.Document> toPackageDocuments(XMLFormatVersion vers)
          The documents to include in a package.
abstract  org.jdom.Element toPackageLibrariesElement(XMLFormatVersion vers)
          The element to include in the "script-lc.xml" entry in a package.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIR_NAME

public static final java.lang.String DIR_NAME
See Also:
Constant Field Values

DIALOG_DIR_NAME

public static final java.lang.String DIALOG_DIR_NAME
See Also:
Constant Field Values

LIBRARY_LIST_FILENAME

public static final java.lang.String LIBRARY_LIST_FILENAME
See Also:
Constant Field Values

MODULE_LIST_FILENAME

public static final java.lang.String MODULE_LIST_FILENAME
See Also:
Constant Field Values

DIALOG_LIBRARY_LIST_FILENAME

public static final java.lang.String DIALOG_LIBRARY_LIST_FILENAME
See Also:
Constant Field Values

DIALOG_LIST_FILENAME

public static final java.lang.String DIALOG_LIST_FILENAME
See Also:
Constant Field Values
Method Detail

removeFromPackage

public static final boolean removeFromPackage(ODPackage pkg,
                                              java.lang.String libName)

getName

public final java.lang.String getName()

isReadonly

public final boolean isReadonly()

toFlatXML

public abstract org.jdom.Element toFlatXML(XMLFormatVersion vers)
The element to define this in a flat XML.

Parameters:
vers - the version of the format.
Returns:
an element totally defining this.

toPackageLibrariesElement

public abstract org.jdom.Element toPackageLibrariesElement(XMLFormatVersion vers)
The element to include in the "script-lc.xml" entry in a package.

Parameters:
vers - the version of the format.
Returns:
an element defining the properties of this.
See Also:
toPackageDocuments(XMLFormatVersion)

toPackageDocuments

public abstract java.util.Map<java.lang.String,org.jdom.Document> toPackageDocuments(XMLFormatVersion vers)
The documents to include in a package.

Parameters:
vers - the version of the format.
Returns:
documents totally defining this, by file name.

toPackageDialogDocuments

public abstract java.util.Map<java.lang.String,org.jdom.Document> toPackageDialogDocuments(XMLFormatVersion vers)

canBeMerged

public abstract boolean canBeMerged(Library other)
Whether this library can be merged with the passed one. The merge can happen if there's no overlap between the two, or if the content of the overlap is equal (e.g. both define the module 'foo' with the same content).

Parameters:
other - another library.
Returns:
true if this library and the other can be merged.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object