Class OPFItem
java.lang.Object
com.adobe.epubcheck.opf.OPFItem
Immutable representation of an item in a Package Document (OPF). Can
represent a
item element or link elements pointing
to a container resource.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final booleanprivate final booleanprivate final Stringprivate final booleanprivate final booleanprivate final EPUBLocationprivate final Stringprivate final Stringprivate final booleanprivate final booleanprivate final Stringprivate final booleanprivate final booleanprivate final intprivate final io.mola.galimatias.URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()Returns the ID of this item.Returns the media type of this item.getPath()The path of this item (cannot benull).Returns the set ofPropertydeclared on this item or anyitemrefpointing to this item.intReturns the zero-based position of this item in the spine, or-1if this item is not in the spine.io.mola.galimatias.URLgetURL()The URL of this item (cannot benull).booleanReturns whether this item is itself an EPUB content document, or has an EPUB content document in its fallback chain.booleanReturns whether this item is a core media type resource, or has a core media type resource in its fallback chain.booleanReturnstrueiff this item is a remote resource.booleanReturns whether this package document item defines a fallback to another item.inthashCode()booleanReturnstrueiff this item is a Fixed-Layout Document.booleanReturnstrueiff this item is in the spine.booleanisLinear()Returnstrueiff this item is a spine item part of the linear reading order, as declared by theitemref/@linearattribute.booleanisNav()Returnstrueiff this item is a Navigation Document.booleanisNcx()Returnstrueiff this item is an NCX document.booleanisRemote()Returnstrueiff this item is a remote resource.booleanReturnstrueiff this item is a scripted document.toString()
-
Field Details
-
id
-
url
private final io.mola.galimatias.URL url -
location
-
path
-
mimetype
-
hasFallback
private final boolean hasFallback -
hasCoreMediaTypeFallback
private final boolean hasCoreMediaTypeFallback -
hasContentDocumentFallback
private final boolean hasContentDocumentFallback -
properties
-
ncx
private final boolean ncx -
inSpine
private final boolean inSpine -
spinePosition
private final int spinePosition -
scripted
private final boolean scripted -
linear
private final boolean linear -
fixedLayout
private final boolean fixedLayout -
remote
private final boolean remote -
mediaOverlay
-
-
Constructor Details
-
OPFItem
-
-
Method Details
-
getId
Returns the ID of this item.- Returns:
- the ID of this item, guaranteed non-null.
-
getURL
public io.mola.galimatias.URL getURL()The URL of this item (cannot benull).- Returns:
- the container URL of this item
-
getPath
-
getMimeType
Returns the media type of this item.- Returns:
- the media type of this item, guaranteed non-null.
-
getLocation
- Returns:
- the location in the package document where this item is declared
-
hasFallback
public boolean hasFallback()Returns whether this package document item defines a fallback to another item.- Returns:
trueiff this item has a fallback item.
-
hasCoreMediaTypeFallback
public boolean hasCoreMediaTypeFallback()Returns whether this item is a core media type resource, or has a core media type resource in its fallback chain.- Returns:
trueiff a core media type resource was found in the fallback chain (can be itself)
-
hasContentDocumentFallback
public boolean hasContentDocumentFallback()Returns whether this item is itself an EPUB content document, or has an EPUB content document in its fallback chain.- Returns:
trueiff an EPUB content document was found in the fallback chain (can be itself)
-
getProperties
-
getSpinePosition
public int getSpinePosition()Returns the zero-based position of this item in the spine, or-1if this item is not in the spine.- Returns:
- the position of this item in the spine, or
-1if this item is not in the spine.
-
isNcx
public boolean isNcx()Returnstrueiff this item is an NCX document.- Returns:
trueiff this item is an NCX document.
-
isScripted
public boolean isScripted()Returnstrueiff this item is a scripted document.- Returns:
trueiff this item is a scripted document.
-
isInSpine
public boolean isInSpine()Returnstrueiff this item is in the spine.- Returns:
trueiff this item is in the spine.
-
isLinear
public boolean isLinear()Returnstrueiff this item is a spine item part of the linear reading order, as declared by theitemref/@linearattribute.- Returns:
trueiff this item is in the spine and is linear.- Throws:
IllegalStateException- if this item is not in the spine.
-
isFixedLayout
public boolean isFixedLayout()Returnstrueiff this item is a Fixed-Layout Document.- Returns:
trueiff this item is a Fixed-Layout Document.
-
hasDataURL
public boolean hasDataURL()Returnstrueiff this item is a remote resource.- Returns:
trueiff this item is a remote resource.
-
isRemote
public boolean isRemote()Returnstrueiff this item is a remote resource.- Returns:
trueiff this item is a remote resource.
-
getMediaOverlay
-
toString
-
hashCode
-
equals
-