Package com.adobe.epubcheck.opf
Class OPFItem
- java.lang.Object
-
- com.adobe.epubcheck.opf.OPFItem
-
public class OPFItem extends java.lang.ObjectImmutable representation of an item in a Package Document (OPF). Can represent aitemelement orlinkelements pointing to a container resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOPFItem.BuilderA builder forOPFItem
-
Field Summary
Fields Modifier and Type Field Description private booleanfixedLayoutprivate booleanhasContentDocumentFallbackprivate booleanhasCoreMediaTypeFallbackprivate booleanhasFallbackprivate java.lang.Stringidprivate booleaninSpineprivate booleanlinearprivate EPUBLocationlocationprivate java.lang.StringmediaOverlayprivate java.lang.Stringmimetypeprivate booleannavprivate booleanncxprivate java.lang.Stringpathprivate java.util.Set<Property>propertiesprivate booleanremoteprivate booleanscriptedprivate intspinePositionprivate io.mola.galimatias.URLurl
-
Constructor Summary
Constructors Modifier Constructor Description privateOPFItem(OPFItem.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetId()Returns the ID of this item.EPUBLocationgetLocation()java.lang.StringgetMediaOverlay()java.lang.StringgetMimeType()Returns the media type of this item.java.lang.StringgetPath()The path of this item (cannot benull).java.util.Set<Property>getProperties()Returns the set ofPropertydeclared on this item or anyitemrefpointing to this item.intgetSpinePosition()Returns 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).booleanhasContentDocumentFallback()Returns whether this item is itself an EPUB content document, or has an EPUB content document in its fallback chain.booleanhasCoreMediaTypeFallback()Returns whether this item is a core media type resource, or has a core media type resource in its fallback chain.booleanhasDataURL()Returnstrueiff this item is a remote resource.booleanhasFallback()Returns whether this package document item defines a fallback to another item.inthashCode()booleanisFixedLayout()Returnstrueiff this item is a Fixed-Layout Document.booleanisInSpine()Returnstrueiff 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.booleanisScripted()Returnstrueiff this item is a scripted document.java.lang.StringtoString()
-
-
-
Field Detail
-
id
private final java.lang.String id
-
url
private final io.mola.galimatias.URL url
-
location
private final EPUBLocation location
-
path
private final java.lang.String path
-
mimetype
private final java.lang.String mimetype
-
hasFallback
private final boolean hasFallback
-
hasCoreMediaTypeFallback
private final boolean hasCoreMediaTypeFallback
-
hasContentDocumentFallback
private final boolean hasContentDocumentFallback
-
properties
private final java.util.Set<Property> properties
-
ncx
private final boolean ncx
-
inSpine
private final boolean inSpine
-
spinePosition
private final int spinePosition
-
nav
private final boolean nav
-
scripted
private final boolean scripted
-
linear
private final boolean linear
-
fixedLayout
private final boolean fixedLayout
-
remote
private final boolean remote
-
mediaOverlay
private final java.lang.String mediaOverlay
-
-
Constructor Detail
-
OPFItem
private OPFItem(OPFItem.Builder builder)
-
-
Method Detail
-
getId
public java.lang.String 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
public java.lang.String getPath()
The path of this item (cannot benull).- Returns:
- the path of this item
-
getMimeType
public java.lang.String getMimeType()
Returns the media type of this item.- Returns:
- the media type of this item, guaranteed non-null.
-
getLocation
public EPUBLocation 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
public java.util.Set<Property> getProperties()
Returns the set ofPropertydeclared on this item or anyitemrefpointing to this item.- Returns:
- the properties of this item, or an empty set if none is declared.
-
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.
-
isNav
public boolean isNav()
Returnstrueiff this item is a Navigation Document.- Returns:
trueiff this item is an Navigation 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:
java.lang.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
public java.lang.String getMediaOverlay()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-