Class XMLMagicNumber
- java.lang.Object
-
- org.arakhne.afc.inputoutput.filetype.MagicNumber
-
- org.arakhne.afc.inputoutput.filetype.XMLMagicNumber
-
- All Implemented Interfaces:
Comparable<MagicNumber>
- Direct Known Subclasses:
DTDBasedXMLMagicNumber
,XSLBasedXMLMagicNumber
public abstract class XMLMagicNumber extends MagicNumber
This class defines a set of informations that could distinguish a file content from another one. It is also known as Magic Number on several operating systems.This magic number supports XML files.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:40
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- inputoutput
-
-
Constructor Summary
Constructors Constructor Description XMLMagicNumber(javax.activation.MimeType mimeType, String rootNode)
Constructor.XMLMagicNumber(javax.activation.MimeType mimeType, String rootNode, String formatVersion)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
isContentType(String schemaId, String schemaVersion, String systemId, String publicId)
Replies if the specified stream contains data that corresponds to this magic number.protected boolean
isContentType(MagicNumberStream stream)
Replies if the specified stream contains data that corresponds to this magic number.-
Methods inherited from class org.arakhne.afc.inputoutput.filetype.MagicNumber
compareTo, doStreamEncoding, getFormatVersion, getHostMimeTypes, getMimeType, undoStreamEncoding
-
-
-
-
Field Detail
-
XMLNS
static final String XMLNS
Name of the attribute "xmlns".- See Also:
- Constant Field Values
-
VERSION
static final String VERSION
Name of the attribute "version".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLMagicNumber
public XMLMagicNumber(javax.activation.MimeType mimeType, String rootNode)
Constructor.- Parameters:
mimeType
- is the MIME type associated to this magic number.rootNode
- is the name of the XML root node from which XLS information may be extracted.
-
XMLMagicNumber
public XMLMagicNumber(javax.activation.MimeType mimeType, String rootNode, String formatVersion)
Constructor.- Parameters:
mimeType
- is the MIME type associated to this magic number.rootNode
- is the name of the XML root node from which XLS information may be extracted.formatVersion
- is the version of the supported format.
-
-
Method Detail
-
isContentType
protected final boolean isContentType(MagicNumberStream stream)
Description copied from class:MagicNumber
Replies if the specified stream contains data that corresponds to this magic number.- Specified by:
isContentType
in classMagicNumber
- Parameters:
stream
- is the stream to analyse.- Returns:
true
if the stream is containing this magic number, otherwisefalse
-
isContentType
protected abstract boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId)
Replies if the specified stream contains data that corresponds to this magic number.- Parameters:
schemaId
- is the ID of the XSL schema associated to this magic number.schemaVersion
- is the ID of the XSL schema associated to this magic number.systemId
- is the DTD system ID associated to this magic number.publicId
- is the DTD system ID associated to this magic number.- Returns:
true
if this magic number is corresponding to the given XML document, otherwisefalse
-
-