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 String
BUILDFILE_EXTENSION_ELEMENT
protected static String
BUILDFILE_MODULE_ELEMENT1
protected static String
BUILDFILE_MODULE_ELEMENT2
protected static String
DATE_SAVED_ELEMENT
protected static String
DESCRIPTION_ATTR
protected static String
DESCRIPTION_ELEMENT
protected VASSAL.build.module.metadata.AbstractMetaData.Attribute
descriptionAttr
protected static String
EXTENSION_ATTR
protected static String
FALSE
protected static String
LANG_ATTR
protected static String
MODULE_NAME_ATTR
protected static String
MODULE_NAME_ELEMENT
protected static String
MODULE_VERSION_ATTR
protected static String
MODULE_VERSION_ELEMENT
protected static String
NAME_ATTR
protected static String
NAME_ELEMENT
protected static XMLReader
parser
This is the shared parser for all subclasses of AbstractMetaData.protected static String
ROOT_ELEMENT
protected static String
TRUE
protected static String
VASSAL_VERSION_ATTR
protected static String
VASSAL_VERSION_ELEMENT
protected String
vassalVersion
protected String
version
protected static String
VERSION_ATTR
protected static String
VERSION_ELEMENT
-
Constructor Summary
Constructors Constructor Description AbstractMetaData()
-
Method Summary
Modifier and Type Method Description protected abstract void
addElements(Document doc, Element root)
Add elements specific to a MetaData subclassvoid
copyModuleMetadata(ArchiveWriter archive)
Copy the Module metatdata from the current module into the specified archive.void
copyModuleMetadata(FileArchive archive)
String
getDescription()
String
getLocalizedDescription()
abstract String
getMetaDataVersion()
Return the version of the metadata structureString
getVassalVersion()
String
getVersion()
abstract String
getZipEntryName()
Return the Entry name for the metatdata fileprotected void
save(OutputStream out)
void
save(ArchiveWriter archive)
Write common metadata to the specified Archive.void
save(FileArchive archive)
void
setDescription(String desc)
void
setDescription(VASSAL.build.module.metadata.AbstractMetaData.Attribute desc)
void
setVassalVersion(String s)
void
setVersion(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
-