Class JsonHandler
- java.lang.Object
-
- edu.harvard.hul.ois.jhove.HandlerBase
-
- edu.harvard.hul.ois.jhove.handler.JsonHandler
-
- All Implemented Interfaces:
OutputHandler
public class JsonHandler extends HandlerBase
OutputHandler for JSON output.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.harvard.hul.ois.jhove.HandlerBase
HandlerBase.SynchronizedDateFormat
-
-
Constructor Summary
Constructors Constructor Description JsonHandler()Creates an JsonHandler.JsonHandler(String name, String release, int[] date, String note, String rights)Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intpropertyLength(Property property)Gives the length (number of elements) of a propertyvoidshow()Outputs minimal information about the applicationvoidshow(App app)Outputs detailed information about the application, including configuration, available modules and handlers, etc.voidshow(Module module)Outputs information about a Modulevoidshow(OutputHandler handler)Outputs information about the OutputHandler specified in the parametervoidshow(RepInfo info)Outputs the information contained in a RepInfo objectprotected javax.json.JsonObjectBuildershowAESAudioMetadata(AESAudioMetadata aes)Display the audio metadata formatted according to the AES schema.protected javax.json.JsonObjectBuildershowAgent(Agent agent, String label)PRIVATE INSTANCE METHODS.protected javax.json.JsonArrayBuildershowArray(double[] darray)protected javax.json.JsonArrayBuildershowArray(int[] iarray)protected javax.json.JsonArrayBuildershowArray(Rational[] rarray)protected javax.json.JsonArrayBuildershowArray(String[] sarray)protected javax.json.JsonObjectBuildershowArrayProperty(Property property)protected javax.json.JsonObjectBuildershowChangeHistory(NisoImageMetadata niso, boolean bMix10)protected javax.json.JsonObjectBuildershowChecksum(Checksum checksum)protected javax.json.JsonObjectBuildershowDocument(Document document)voidshowFooter()Do the final output.voidshowHeader()Do the initial output.protected javax.json.JsonObjectBuildershowIdentifier(Identifier identifier)protected javax.json.JsonObjectBuildershowListProperty(Property property)protected javax.json.JsonObjectBuildershowMapProperty(Property property)protected javax.json.JsonObjectBuildershowMessage(Message message)protected javax.json.JsonObjectBuildershowNisoBasicDigitalObjectInformation(NisoImageMetadata niso, boolean bMix10)protected javax.json.JsonObjectBuildershowNisoBasicImageInformation(NisoImageMetadata niso, boolean bMix10)protected javax.json.JsonObjectBuildershowNisoImageAssessmentMetadata(NisoImageMetadata niso, boolean bMix10)protected javax.json.JsonObjectBuildershowNisoImageCaptureMetadata(NisoImageMetadata niso, boolean bMix10)protected javax.json.JsonObjectBuildershowNisoImageMetadata(NisoImageMetadata niso)Display the NISO image metadata formatted according to the MIX schema.protected javax.json.JsonObjectBuildershowNisoImageMetadata(NisoImageMetadata niso, boolean bMix10)Display the NISO image metadata formatted according to the MIX 1.0 schema.protected javax.json.JsonObjectBuildershowProperty(Property property)protected javax.json.JsonArrayBuildershowRational(Rational r)protected javax.json.JsonObjectBuildershowScalarProperty(Property property)protected javax.json.JsonObjectBuildershowSetProperty(Property property)protected javax.json.JsonObjectBuildershowSignature(Signature signature)protected javax.json.JsonObjectBuildershowTextMDMetadata(TextMDMetadata textMD)protected StringvalueToString(Object obj)-
Methods inherited from class edu.harvard.hul.ois.jhove.HandlerBase
analyze, applyDefaultParams, close, doctype, doctype, doubleArray, element, element, element, element, elementEnd, elementStart, elementStart, endDirectory, getDate, getEncoding, getIndent, getName, getNote, getRelease, getRights, getSpecification, getVendor, init, integerArray, integerArray, longArray, okToProcess, param, rationalArray, rationalArray10, reset, resetParams, setApp, setBase, setDefaultParams, setEncoding, setWriter, startDirectory, toDateTime, xmlDecl, xmlDecl
-
-
-
-
Method Detail
-
show
public void show()
Outputs minimal information about the application- Specified by:
showin interfaceOutputHandler- Specified by:
showin classHandlerBase
-
show
public void show(App app)
Outputs detailed information about the application, including configuration, available modules and handlers, etc.- Specified by:
showin interfaceOutputHandler- Specified by:
showin classHandlerBase
-
show
public void show(OutputHandler handler)
Outputs information about the OutputHandler specified in the parameter- Specified by:
showin interfaceOutputHandler- Specified by:
showin classHandlerBase
-
show
public void show(Module module)
Outputs information about a Module- Specified by:
showin interfaceOutputHandler- Specified by:
showin classHandlerBase
-
show
public void show(RepInfo info)
Outputs the information contained in a RepInfo object- Specified by:
showin interfaceOutputHandler- Specified by:
showin classHandlerBase
-
showAgent
protected javax.json.JsonObjectBuilder showAgent(Agent agent, String label)
PRIVATE INSTANCE METHODS.
-
showChecksum
protected javax.json.JsonObjectBuilder showChecksum(Checksum checksum)
-
showDocument
protected javax.json.JsonObjectBuilder showDocument(Document document)
-
showFooter
public void showFooter()
Do the final output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.- Specified by:
showFooterin interfaceOutputHandler- Specified by:
showFooterin classHandlerBase
-
showHeader
public void showHeader()
Do the initial output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.- Specified by:
showHeaderin interfaceOutputHandler- Specified by:
showHeaderin classHandlerBase
-
showIdentifier
protected javax.json.JsonObjectBuilder showIdentifier(Identifier identifier)
-
showMessage
protected javax.json.JsonObjectBuilder showMessage(Message message)
-
showSignature
protected javax.json.JsonObjectBuilder showSignature(Signature signature)
-
showProperty
protected javax.json.JsonObjectBuilder showProperty(Property property)
-
showScalarProperty
protected javax.json.JsonObjectBuilder showScalarProperty(Property property)
-
showListProperty
protected javax.json.JsonObjectBuilder showListProperty(Property property)
-
showSetProperty
protected javax.json.JsonObjectBuilder showSetProperty(Property property)
-
showMapProperty
protected javax.json.JsonObjectBuilder showMapProperty(Property property)
-
propertyLength
protected int propertyLength(Property property)
Gives the length (number of elements) of a property
-
showArrayProperty
protected javax.json.JsonObjectBuilder showArrayProperty(Property property)
-
showTextMDMetadata
protected javax.json.JsonObjectBuilder showTextMDMetadata(TextMDMetadata textMD)
-
showNisoImageMetadata
protected javax.json.JsonObjectBuilder showNisoImageMetadata(NisoImageMetadata niso)
Display the NISO image metadata formatted according to the MIX schema. The schema which is used may be 0.2 or 1.0 or 2.0, depending on the module parameters.- Parameters:
niso- NISO image metadata
-
showNisoImageMetadata
protected javax.json.JsonObjectBuilder showNisoImageMetadata(NisoImageMetadata niso, boolean bMix10)
Display the NISO image metadata formatted according to the MIX 1.0 schema.
-
showNisoBasicDigitalObjectInformation
protected javax.json.JsonObjectBuilder showNisoBasicDigitalObjectInformation(NisoImageMetadata niso, boolean bMix10)
-
showNisoBasicImageInformation
protected javax.json.JsonObjectBuilder showNisoBasicImageInformation(NisoImageMetadata niso, boolean bMix10)
-
showNisoImageCaptureMetadata
protected javax.json.JsonObjectBuilder showNisoImageCaptureMetadata(NisoImageMetadata niso, boolean bMix10)
-
showNisoImageAssessmentMetadata
protected javax.json.JsonObjectBuilder showNisoImageAssessmentMetadata(NisoImageMetadata niso, boolean bMix10)
-
showChangeHistory
protected javax.json.JsonObjectBuilder showChangeHistory(NisoImageMetadata niso, boolean bMix10)
-
showAESAudioMetadata
protected javax.json.JsonObjectBuilder showAESAudioMetadata(AESAudioMetadata aes)
Display the audio metadata formatted according to the AES schema.- Parameters:
aes- AES audio metadata- Returns:
- Json
-
showArray
protected javax.json.JsonArrayBuilder showArray(int[] iarray)
-
showArray
protected javax.json.JsonArrayBuilder showArray(double[] darray)
-
showArray
protected javax.json.JsonArrayBuilder showArray(String[] sarray)
-
showArray
protected javax.json.JsonArrayBuilder showArray(Rational[] rarray)
-
showRational
protected javax.json.JsonArrayBuilder showRational(Rational r)
-
-