Package edu.harvard.hul.ois.jhove
Class RepInfo
- java.lang.Object
-
- edu.harvard.hul.ois.jhove.RepInfo
-
- All Implemented Interfaces:
Cloneable
public class RepInfo extends Object implements Cloneable
This class encapsulates representation information, as defined by ISO/IEC 14721, about a content stream.- See Also:
- ISO/IEC 14721 (PDF)
-
-
Field Summary
Fields Modifier and Type Field Description static intFALSEValues for _validstatic intTRUEValues for _validstatic intUNDETERMINEDValues for _valid
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Clones the RepInfo one level deep, making fresh copies of the checksum, message, profile, signature match, and property fields.voidcopy(RepInfo info)Copies all the information out of the parameter object.PropertygetByName(String name)Return property by name, regardless of its position in the property hierarchy.List<Checksum>getChecksum()Returns this object's list of ChecksumsDategetCreated()Returns the creation date stored in this object.StringgetFormat()Return the format identifierDategetLastModified()Returns the last modified date stored in this object.List<Message>getMessage()Returns the message list stored in this objectStringgetMimeType()Returns the MIME type string stored in this objectModulegetModule()Return the module.StringgetNote()Returns the note property stored in this objectList<String>getProfile()Returns the list of profiles (Strings) stored in this objectMap<String,Property>getProperty()Returns the Property map stored in this object.PropertygetProperty(String name)Returns a named Property from the Property mapList<String>getSigMatch()Returns the list of matching signatures.longgetSize()Returns the size property stored in this object.StringgetUri()Returns the URI property stored in this object.booleangetURLFlag()Returns a flag which, iftrue, indicates the object is a URL.intgetValid()Returns the value of the validity flag.StringgetVersion()Returns the version property stored in this objectintgetWellFormed()Returns the value of the well-formed flag.booleanisConsistent()Returns the value of the consistency flag.voidsetChecksum(Checksum checksum)Append a Checksum object to the checksum list.voidsetConsistent(boolean consistent)Set the value of the consistency flagvoidsetCreated(Date created)Set the creation datevoidsetFormat(String format)Set the format identifiervoidsetLastModified(Date lastModified)Set the last modified datevoidsetMessage(Message message)Append a Message object to the message listvoidsetMimeType(String mimeType)Set the MIME type stringvoidsetModule(Module module)Add the module.voidsetNote(String note)Set the note stringvoidsetProfile(String profile)Append a profile String to the profile listvoidsetProperty(Property property)Add a Property to the property map.voidsetSigMatch(String modname)Adds the name of a module, signifying that the document signature matched the module's requirements.voidsetSigMatch(List<String> modnames)Adds a list of module names, signifying that the document signature matched the module's requirements.voidsetSize(long size)Set the size propertyvoidsetURLFlag(boolean flag)Set the flag to indicate whether this is a URL (true) or a file (false)voidsetValid(boolean valid)Set the validity flagvoidsetValid(int valid)Set the validity flagvoidsetVersion(String version)Set the version stringvoidsetWellFormed(boolean wellFormed)Set the well-formed flagvoidsetWellFormed(int wellFormed)Set the wellFormed flag.voidshow(OutputHandler handler)Output the information in this object.
-
-
-
Field Detail
-
TRUE
public static final int TRUE
Values for _valid- See Also:
- Constant Field Values
-
FALSE
public static final int FALSE
Values for _valid- See Also:
- Constant Field Values
-
UNDETERMINED
public static final int UNDETERMINED
Values for _valid- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RepInfo
public RepInfo(String uri)
Creates a RepInfo with a URI reference- Parameters:
uri- Object file pathname or URI
-
-
Method Detail
-
clone
public Object clone()
Clones the RepInfo one level deep, making fresh copies of the checksum, message, profile, signature match, and property fields. The external RepInfo (if any) is not cloned, but is attached directly to the clone.
-
copy
public void copy(RepInfo info)
Copies all the information out of the parameter object. This is a "shallow" copy; it is assumed that the parameter object is a temporary one that will not be further modified.
-
getCreated
public Date getCreated()
Returns the creation date stored in this object. A creation date is not automatically generated, but must be explicitly stored.
-
getFormat
public String getFormat()
Return the format identifier
-
getLastModified
public Date getLastModified()
Returns the last modified date stored in this object. A date is not automatically generated, but must be explicitly stored.
-
getMimeType
public String getMimeType()
Returns the MIME type string stored in this object
-
getModule
public Module getModule()
Return the module.
-
getProfile
public List<String> getProfile()
Returns the list of profiles (Strings) stored in this object
-
getProperty
public Map<String,Property> getProperty()
Returns the Property map stored in this object. The Property map contains key-value pairs whose key is aStringand whose value is aProperty.
-
getProperty
public Property getProperty(String name)
Returns a named Property from the Property map- Parameters:
name- The name of the Property.
-
getSize
public long getSize()
Returns the size property stored in this object.
-
getUri
public String getUri()
Returns the URI property stored in this object.
-
getURLFlag
public boolean getURLFlag()
Returns a flag which, iftrue, indicates the object is a URL.
-
isConsistent
public boolean isConsistent()
Returns the value of the consistency flag.
-
getWellFormed
public int getWellFormed()
Returns the value of the well-formed flag. Can return TRUE, FALSE, or UNDETERMINED.
-
getValid
public int getValid()
Returns the value of the validity flag. Can return TRUE, FALSE, or UNDETERMINED.
-
getVersion
public String getVersion()
Returns the version property stored in this object
-
getNote
public String getNote()
Returns the note property stored in this object
-
getSigMatch
public List<String> getSigMatch()
Returns the list of matching signatures. JhoveBase will make this value persistent across module invocations for a given document, so the list returned will reflect all modules that have looked at the document so far.
-
getByName
public Property getByName(String name)
Return property by name, regardless of its position in the property hierarchy.- Parameters:
name- Property name- Returns:
- Named property (or null)
-
setChecksum
public void setChecksum(Checksum checksum)
Append a Checksum object to the checksum list.
-
setConsistent
public void setConsistent(boolean consistent)
Set the value of the consistency flag
-
setCreated
public void setCreated(Date created)
Set the creation date
-
setFormat
public void setFormat(String format)
Set the format identifier
-
setLastModified
public void setLastModified(Date lastModified)
Set the last modified date
-
setMessage
public void setMessage(Message message)
Append a Message object to the message list
-
setMimeType
public void setMimeType(String mimeType)
Set the MIME type string
-
setModule
public void setModule(Module module)
Add the module.
-
setProfile
public void setProfile(String profile)
Append a profile String to the profile list
-
setProperty
public void setProperty(Property property)
Add a Property to the property map. The name of the Property becomes its key in the map.
-
setSize
public void setSize(long size)
Set the size property
-
setURLFlag
public void setURLFlag(boolean flag)
Set the flag to indicate whether this is a URL (true) or a file (false)
-
setWellFormed
public void setWellFormed(boolean wellFormed)
Set the well-formed flag- Parameters:
wellFormed- Boolean argument that maps to an integer value: true maps to TRUE, and false to FALSE.
-
setWellFormed
public void setWellFormed(int wellFormed)
Set the wellFormed flag. Setting wellFormed to false forces the consistent and valid flags to be false as well.
-
setValid
public void setValid(boolean valid)
Set the validity flag- Parameters:
valid- Boolean argument that maps to an integer value: true maps to TRUE, and false to FALSE.
-
setValid
public void setValid(int valid)
Set the validity flag- Parameters:
valid- Permitted values are TRUE, FALSE, AND UNDETERMINED. The effect of using other values is undefined.
-
setVersion
public void setVersion(String version)
Set the version string
-
setNote
public void setNote(String note)
Set the note string
-
setSigMatch
public void setSigMatch(String modname)
Adds the name of a module, signifying that the document signature matched the module's requirements. JhoveBase will make this value persistent across module invocations for a given document.
-
setSigMatch
public void setSigMatch(List<String> modnames)
Adds a list of module names, signifying that the document signature matched the module's requirements. Any previous list is lost. JhoveBase will make this value persistent across module invocations for a given document.
-
show
public void show(OutputHandler handler)
Output the information in this object. The format and destination of the output are determined by the OutputHandler.
-
-