Package VASSAL.build.module.metadata
Class AbstractMetaData
java.lang.Object
VASSAL.build.module.metadata.AbstractMetaData
- Direct Known Subclasses:
ExtensionMetaData,ImportMetaData,ModuleMetaData,SaveMetaData
public abstract class AbstractMetaData extends Object
Base class representing the metadata for a Saved Game, Module or Extension.
- Since:
- 3.1.0
- Author:
- Brent Easton
-
Field Summary
Fields Modifier and Type Field Description protected static StringBUILDFILE_EXTENSION_ELEMENTprotected static StringBUILDFILE_MODULE_ELEMENT1protected static StringBUILDFILE_MODULE_ELEMENT2protected static StringDATE_SAVED_ELEMENTprotected static StringDESCRIPTION_ATTRprotected static StringDESCRIPTION_ELEMENTprotected VASSAL.build.module.metadata.AbstractMetaData.AttributedescriptionAttrprotected static StringEXTENSION_ATTRprotected static StringFALSEprotected static StringLANG_ATTRprotected static StringMODULE_NAME_ATTRprotected static StringMODULE_NAME_ELEMENTprotected static StringMODULE_VERSION_ATTRprotected static StringMODULE_VERSION_ELEMENTprotected static StringNAME_ATTRprotected static StringNAME_ELEMENTprotected static XMLReaderparserThis is the shared parser for all subclasses of AbstractMetaData.protected static StringROOT_ELEMENTprotected static StringTRUEprotected static StringVASSAL_VERSION_ATTRprotected static StringVASSAL_VERSION_ELEMENTprotected StringvassalVersionprotected Stringversionprotected static StringVERSION_ATTRprotected static StringVERSION_ELEMENT -
Constructor Summary
Constructors Constructor Description AbstractMetaData() -
Method Summary
Modifier and Type Method Description protected abstract voidaddElements(Document doc, Element root)Add elements specific to a MetaData subclassvoidcopyModuleMetadata(ArchiveWriter archive)Copy the Module metatdata from the current module into the specified archive.voidcopyModuleMetadata(FileArchive archive)StringgetDescription()StringgetLocalizedDescription()abstract StringgetMetaDataVersion()Return the version of the metadata structureStringgetVassalVersion()StringgetVersion()abstract StringgetZipEntryName()Return the Entry name for the metatdata fileprotected voidsave(OutputStream out)voidsave(ArchiveWriter archive)Write common metadata to the specified Archive.voidsave(FileArchive archive)voidsetDescription(String desc)voidsetDescription(VASSAL.build.module.metadata.AbstractMetaData.Attribute desc)voidsetVassalVersion(String s)voidsetVersion(String s)
-
Field Details
-
TRUE
- See Also:
- Constant Field Values
-
FALSE
- See Also:
- Constant Field Values
-
NAME_ATTR
- See Also:
- Constant Field Values
-
VERSION_ATTR
- See Also:
- Constant Field Values
-
VASSAL_VERSION_ATTR
- See Also:
- Constant Field Values
-
DESCRIPTION_ATTR
- See Also:
- Constant Field Values
-
EXTENSION_ATTR
- See Also:
- Constant Field Values
-
MODULE_NAME_ATTR
- See Also:
- Constant Field Values
-
MODULE_VERSION_ATTR
- See Also:
- Constant Field Values
-
LANG_ATTR
- See Also:
- Constant Field Values
-
ROOT_ELEMENT
- See Also:
- Constant Field Values
-
VERSION_ELEMENT
- See Also:
- Constant Field Values
-
VASSAL_VERSION_ELEMENT
- See Also:
- Constant Field Values
-
MODULE_NAME_ELEMENT
- See Also:
- Constant Field Values
-
MODULE_VERSION_ELEMENT
- See Also:
- Constant Field Values
-
DESCRIPTION_ELEMENT
- See Also:
- Constant Field Values
-
NAME_ELEMENT
- See Also:
- Constant Field Values
-
DATE_SAVED_ELEMENT
- See Also:
- Constant Field Values
-
BUILDFILE_MODULE_ELEMENT1
- See Also:
- Constant Field Values
-
BUILDFILE_MODULE_ELEMENT2
- See Also:
- Constant Field Values
-
BUILDFILE_EXTENSION_ELEMENT
- See Also:
- Constant Field Values
-
version
-
vassalVersion
-
descriptionAttr
protected VASSAL.build.module.metadata.AbstractMetaData.Attribute descriptionAttr -
parser
This is the shared parser for all subclasses of AbstractMetaData. We use a shared parser. All uses of this parser must be wrapped in a block synchronized on the parser itself.
-
-
Constructor Details
-
AbstractMetaData
public AbstractMetaData()
-
-
Method Details
-
getVersion
-
setVersion
-
getVassalVersion
-
setVassalVersion
-
setDescription
public void setDescription(VASSAL.build.module.metadata.AbstractMetaData.Attribute desc) -
setDescription
-
getDescription
-
getLocalizedDescription
-
save
- Throws:
IOException
-
save
- Throws:
IOException
-
save
Write common metadata to the specified Archive. Call addElements to add elements specific to particular concrete subclasses.- Parameters:
archive- Extension Archive- Throws:
IOException- If anything goes wrong
-
copyModuleMetadata
Copy the Module metatdata from the current module into the specified archive.- Parameters:
archive- Archive to copy into- Throws:
IOException
-
copyModuleMetadata
- Throws:
IOException
-
getZipEntryName
Return the Entry name for the metatdata file- Returns:
- Zip Entry name
-
getMetaDataVersion
Return the version of the metadata structure- Returns:
- version
-
addElements
Add elements specific to a MetaData subclass- Parameters:
doc- Documentroot- Root element
-