Commits

mstrong  committed fe9aba6 Merge

merging slabrams fork into main

  • Participants
  • Parent commits 401a662, f5fbf2e

Comments (0)

Files changed (29)

File config/messages/jhove2_messages.properties

 #   Message templates for class org.jhove2.module.format.wave.bwf.BroadcastWaveFormatProfile
 # ##############################################################################
 # 
+org.jhove2.module.format.wave.bwf.BroadcastWaveFormatProfile.baselineWAVEFormatIsInvalid=Baseline WAVE format is invalid
 org.jhove2.module.format.wave.bwf.BroadcastWaveFormatProfile.missingRequiredBextChunk=Missing required broadcast audio extension chunk
 org.jhove2.module.format.wave.bwf.BroadcastWaveFormatProfile.missingRequiredMPEG1Chunk=Missing required MPEG-1 chunk
 #

File config/properties/module/format/riff/chunk-classes.properties

-# RIFF chunks.
-# Note that meaningful spaces in types MUST be escaped with a backslash
-
-_PMX : org.jhove2.module.format.wave.XMPChunk
-axml : org.jhove2.module.fomat.wave.bwf.AXMLChunk
-bext : org.jhove2.module.format.wave.bwf.BroadcastAudioExtensionChunk
-cue\ : org.jhove2.module.format.wave.CuePointsChunk
-fact : org.jhove2.module.format.wave.FactChunk
-file : org.jhove2.module.format.wave.FileChunk
-fmt\ : org.jhove2.module.format.wave.FormatChunk
-IARL : org.jhove2.module.format.riff.ZSTRChunk
-IART : org.jhove2.module.format.riff.ZSTRChunk
-ICMS : org.jhove2.module.format.riff.ZSTRChunk
-ICMT : org.jhove2.module.format.riff.ZSTRChunk
-ICOP : org.jhove2.module.format.riff.ZSTRChunk
-ICRD : org.jhove2.module.format.riff.ZSTRChunk
-ICRP : org.jhove2.module.format.riff.ZSTRChunk
-IDIM : org.jhove2.module.format.riff.ZSTRChunk
-IDPI : org.jhove2.module.format.riff.ZSTRChunk
-IENG : org.jhove2.module.format.riff.ZSTRChunk
-IGNR : org.jhove2.module.format.riff.ZSTRChunk
-IKEY : org.jhove2.module.format.riff.ZSTRChunk
-ILGT : org.jhove2.module.format.riff.ZSTRChunk
-IMED : org.jhove2.module.format.riff.ZSTRChunk
-INAM : org.jhove2.module.format.riff.ZSTRChunk
-inst : org.jhove2.module.format.wave.InstrumentChunk
-IPLT : org.jhove2.module.format.riff.ZSTRChunk
-IPRD : org.jhove2.module.format.riff.ZSTRChunk
-ISBJ : org.jhove2.module.format.riff.ZSTRChunk
-ISFT : org.jhove2.module.format.riff.ZSTRChunk
-ISHP : org.jhove2.module.format.riff.ZSTRChunk
-ISRC : org.jhove2.module.format.riff.ZSTRChunk
-ISRF : org.jhove2.module.format.riff.ZSTRChunk
-ITCH : org.jhove2.module.format.riff.ZSTRChunk
-iXML : org.jhove2.module.format.wave.bwf.IXMLChunk
-labl : org.jhove2.module.format.wave.NamedZSTRChunk
-levl : org.jhove2.module.format.wave.bwf.PeakEnvelopeChunk
-link : org.jhove2.module.format.wave.bwf.LinkChunk
-LIST : org.jhove2.module.format.riff.LISTChunk
-ltxt : org.jhove2.module.format.wave.TextWithDataLengthChunk
-mext : org.jhove2.module.format.wave.MPEGChunk
-note : org.jhove2.module.format.wave.NamedZSTRChunk
-plst : org.jhove2.module.format.wave.PlaylistChunk
-qlty : org.jhove2.module.format.wave.bwf.QualityChunk
-RIFF : org.jhove2.module.format.riff.RIFFChunk
-slnt : org.jhove2.module.format.wave.SilenceChunk

File config/spring/module/format/riff/jhove2-riff-config.xml

            http://www.springframework.org/schema/context/spring-context-2.5.xsd
 		   http://www.springframework.org/schema/util 
 		   http://www.springframework.org/schema/util/spring-util-2.0.xsd">
-				 			    
-	<!-- RIFF chunk classes properties bean --> 
-	<bean id="ChunkClasses" class="org.jhove2.config.spring.ModulePropertiesFactoryBean">
-		<property name="propertyFileBaseName" value="chunk-classes"/>
-	</bean> 
-	     
+
+	<!-- RIFF IARL chunk bean -->
+	<bean id="IARLChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IARL"/>
+	</bean>
+
+	<!-- RIFF IART chunk bean -->
+	<bean id="IARTChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IART"/>
+	</bean>
+
+	<!-- RIFF ICMS chunk bean -->
+	<bean id="ICMSChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ICMS"/>
+	</bean>
+
+	<!-- RIFF ICMT chunk bean -->
+	<bean id="ICMTChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ICMT"/>
+	</bean>
+
+	<!-- RIFF ICOP chunk bean -->
+	<bean id="ICOPChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ICOP"/>
+	</bean>
+
+	<!-- RIFF ICRD chunk bean -->
+	<bean id="ICRDChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ICRD"/>
+	</bean>
+	
+	<!-- RIFF ICRP chunk bean -->
+	<bean id="ICRPChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ICRP"/>
+	</bean>
+
+	<!-- RIFF IDIM chunk bean -->
+	<bean id="IDIMChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IDIM"/>
+	</bean>
+
+	<!-- RIFF IDPI chunk bean -->
+	<bean id="IDPIChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IDPI"/>
+	</bean>
+
+	<!-- RIFF IENG chunk bean -->
+	<bean id="IENGChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IENG"/>
+	</bean>
+
+	<!-- RIFF IGNR chunk bean -->
+	<bean id="IGNRChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IGNR"/>
+	</bean>
+
+	<!-- RIFF IKEY chunk bean -->
+	<bean id="IKEYChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IKEY"/>
+	</bean>
+
+	<!-- RIFF ILGT chunk bean -->
+	<bean id="ILGTChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ILGT"/>
+	</bean>
+
+	<!-- RIFF IMED chunk bean -->
+	<bean id="IMEDChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IMED"/>
+	</bean>
+
+	<!-- RIFF INAM chunk bean -->
+	<bean id="INAMChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="INAM"/>
+	</bean>
+
+	<!-- RIFF IPLT chunk bean -->
+	<bean id="IPLTChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IPLT"/>
+	</bean>
+
+	<!-- RIFF IPRD chunk bean -->
+	<bean id="IPRDChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="IPRD"/>
+	</bean>
+
+	<!-- RIFF ISBJ chunk bean -->
+	<bean id="ISBJChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ISBJ"/>
+	</bean>
+
+	<!-- RIFF ISFT chunk bean -->
+	<bean id="ISFTChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ISFT"/>
+	</bean>
+
+	<!-- RIFF ISHP chunk bean -->
+	<bean id="ISHPChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ISHP"/>
+	</bean>
+
+	<!-- RIFF ISRC chunk bean -->
+	<bean id="ISRCChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ISRC"/>
+	</bean>
+
+	<!-- RIFF ISRF chunk bean -->
+	<bean id="ISRFChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ISRF"/>
+	</bean>
+
+	<!-- RIFF ITCH chunk bean -->
+	<bean id="ITCHChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ITCH"/>
+	</bean>
+	
+	<!-- RIFF LIST chunk bean -->
+	<bean id="LISTChunk" class="org.jhove2.module.format.riff.LISTChunk"
+	      scope="prototype">
+	    <property name="identifier" value="LIST"/>
+	    <property name="chunkFactory" ref="ChunkFactory"/>
+	</bean>
+					 	
+	<!-- RIFF chunk bean -->
+	<bean id="RIFFChunk" class="org.jhove2.module.format.riff.RIFFChunk"
+	      scope="prototype">
+	    <property name="identifier" value="RIFF"/>
+	    <property name="chunkFactory" ref="ChunkFactory"/>
+	</bean>
+						 	
+	<!-- RIFF ZSTR chunk bean -->
+	<bean id="ZSTRChunk" class="org.jhove2.module.format.riff.ZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ZSTR"/>
+	</bean>
+							 	
+	<!-- RIFF generic chunk bean -->
+	<bean id="GenericChunk" class="org.jhove2.module.format.riff.GenericChunk"
+	      scope="prototype">
+	    <property name="identifier" value="_J2_"/>
+	</bean>
+	
+	<!-- Spring chunk factory bean -->
+	<bean id="ChunkFactory" class="org.jhove2.config.spring.SpringChunkFactory"
+	      scope="singleton"/>
+ 
 	<!-- RIFF chunk form type properties bean --> 
 	<bean id="FormTypes" class="org.jhove2.config.spring.ModulePropertiesFactoryBean">
 		<property name="propertyFileBaseName" value="form-types"/>

File config/spring/module/format/tiff/jhove2-tiff-config.xml

 				<ref bean="CDLAgent" />
 			</list>
 		</property>
+		<property name="tagToFormatMap">
+		    <map>
+		        <entry key="34675" value-ref="ICCFormat"/>
+		        <entry key="700"   value-ref="XmlFormat"/>
+		    </map>
+		</property>
 	</bean>
 
 

File config/spring/module/format/wave/jhove2-wave-config.xml

 				<ref bean="BroadcastWaveFormatProfile"/>
 			</list>
 		</property>
+		<property name="chunkFactory" ref="ChunkFactory"/>
     </bean>
 	  
   	<!-- Broadcast Wave Format profile bean -->
 	<bean id="PeakPoints" class="org.jhove2.config.spring.ModulePropertiesFactoryBean">
 		<property name="propertyFileBaseName" value="peak-points"/>
 	</bean> 
-	 
+
+	<!-- WAVE _PMX chunk bean -->
+	<bean id="XMPChunk" class="org.jhove2.module.format.wave.XMPChunk"
+	      scope="prototype">
+	    <constructor-arg ref="XmlFormat"/>
+	    <property name="identifier" value="_PMX"/>
+	</bean>
+
+	<!-- Broadcast Wave Format axml chunk bean -->
+	<bean id="AXMLChunk" class="org.jhove2.module.format.wave.bwf.AXMLChunk"
+	      scope="prototype">
+	    <constructor-arg ref="XmlFormat"/>
+	    <property name="identifier" value="axml"/>
+	</bean>
+
+	<!-- Broadcast Wave Format bext chunk bean -->
+	<bean id="BroadcastAudioExtensionChunk"
+	      class="org.jhove2.module.format.wave.bwf.BroadcastAudioExtensionChunk"
+	      scope="prototype">
+	    <property name="identifier" value="bext"/>
+	</bean>
+
+	<!-- WAVE cue chunk bean -->
+	<!-- NOTE: the trailing space in the identifier value -->
+	<bean id="CuePointsChunk" class="org.jhove2.module.format.wave.CuePointsChunk"
+	      scope="prototype">
+	    <property name="identifier" value="cue "/>
+	</bean>
+
+	<!-- WAVE fact chunk bean -->
+	<bean id="FactChunk" class="org.jhove2.module.format.wave.FactChunk"
+	      scope="prototype">
+	    <property name="identifier" value="fact"/>
+	</bean>
+
+	<!-- WAVE file chunk bean -->
+	<bean id="FileChunk" class="org.jhove2.module.format.wave.FileChunk"
+	      scope="prototype">
+	    <property name="identifier" value="file"/>
+	</bean>
+
+	<!-- WAVE fmt chunk bean -->
+	<!-- NOTE: the trailing space in the identifier value -->
+	<bean id="FormatChunk" class="org.jhove2.module.format.wave.FormatChunk"
+	      scope="prototype">
+	    <property name="identifier" value="fmt "/>
+	</bean>
+
+	<!-- WAVE inst chunk bean -->
+	<bean id="InstrumentChunk" class="org.jhove2.module.format.wave.InstrumentChunk"
+	      scope="prototype">
+	    <property name="identifier" value="inst"/>
+	</bean>
+
+	<!-- Broadcast Wave format iXML chunk bean -->
+	<bean id="IXMLChunk" class="org.jhove2.module.format.wave.bwf.IXMLChunk"
+	      scope="prototype">
+	    <constructor-arg ref="XmlFormat"/>
+	    <property name="identifier" value="iXML"/>
+	</bean>
+
+	<!-- WAVE labl chunk bean -->
+	<bean id="LabelChunk" class="org.jhove2.module.format.wave.NamedZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="labl"/>
+	</bean>
+
+	<!-- Broadcast Wave format levl chunk bean -->
+	<bean id="PeakEnvelopeChunk" class="org.jhove2.module.format.wave.bwf.PeakEnvelopeChunk"
+	      scope="prototype">
+	    <property name="identifier" value="link"/>
+	</bean>
+
+	<!-- Broadcast Wave format link chunk bean -->
+	<bean id="LinkChunk" class="org.jhove2.module.format.wave.bwf.LinkChunk"
+	      scope="prototype">
+	    <property name="identifier" value="link"/>
+	</bean>
+
+	<!-- WAVE ltxt chunk bean -->
+	<bean id="LTXTChunk" class="org.jhove2.module.format.wave.TextWithDataLengthChunk"
+	      scope="prototype">
+	    <property name="identifier" value="ltxt"/>
+	</bean>
+
+	<!-- Broadcast Wave Format MPEG chunk bean -->
+	<bean id="MPEGChunk" class="org.jhove2.module.format.wave.bwf.MPEGChunk"
+	      scope="prototype">
+	    <property name="identifier" value="mext"/>
+	</bean>
+
+	<!-- WAVE note chunk bean -->
+	<bean id="NoteChunk" class="org.jhove2.module.format.wave.NamedZSTRChunk"
+	      scope="prototype">
+	    <property name="identifier" value="note"/>
+	</bean>
+	
+	<!-- WAVE plst chunk bean -->
+	<bean id="PlayListChunk" class="org.jhove2.module.format.wave.PlayListChunk"
+	      scope="prototype">
+	    <property name="identifier" value="plst"/>
+	</bean>
+
+	<!-- Broadcast Wave Format qlty chunk bean -->
+	<bean id="QualityChunk" class="org.jhove2.module.format.wave.bwf.QualityChunk"
+	      scope="prototype">
+	    <property name="identifier" value="qlty"/>
+	</bean>
+
+	<!-- WAVE slnt chunk bean -->
+	<bean id="SilenceChunk" class="org.jhove2.module.format.wave.SilenceChunk"
+	      scope="prototype">
+	    <property name="identifier" value="slnt"/>
+	</bean>
+	
 </beans>

File src/main/java/org/jhove2/app/util/traverser/PropertyDoc.java

 		}
 		return retcode;
 	}
-	@Override
-	public boolean equals(Object o){
-		boolean isEqual = false;
-		if (o instanceof PropertyDoc){
-			PropertyDoc p = (PropertyDoc)o;
-			isEqual = dottedName.equals(p.dottedName);
-		}
-		return isEqual;	
-	}
-	/**
+	/** Generate a unique hash code for the property.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((dottedName == null) ? 0 : dottedName.hashCode());
+        return result;
+    }
+    /** Determine equality with another property.
+     * @param obj Property to be compared.
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (!(obj instanceof PropertyDoc))
+            return false;
+        PropertyDoc other = (PropertyDoc) obj;
+        if (dottedName == null) {
+            if (other.dottedName != null)
+                return false;
+        }
+        else if (!dottedName.equals(other.dottedName))
+            return false;
+        return true;
+    }
+    /**
 	 * @return the name
 	 */
 	public String getName() {

File src/main/java/org/jhove2/app/util/traverser/ReportableDoc.java

 		}
 		return retcode;
 	}
-	@Override
-	public boolean equals(Object o){
-		boolean isEqual = false;
-		if (o instanceof ReportableDoc){
-			ReportableDoc p = (ReportableDoc)o;
-			isEqual = id.equals(p.id);
-		}
-		return isEqual;
-	}
-	/**
+	/** Generate a unique hash code for the reportable.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        return result;
+    }
+    /** Determine equality with another reportable.
+     * @param obj Reportable to be compared
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (!(obj instanceof ReportableDoc))
+            return false;
+        ReportableDoc other = (ReportableDoc) obj;
+        if (id == null) {
+            if (other.id != null)
+                return false;
+        }
+        else if (!id.equals(other.id))
+            return false;
+        return true;
+    }
+    /**
 	 * @return the name
 	 */
 	public String getName() {

File src/main/java/org/jhove2/config/spring/SpringChunkFactory.java

+/**
+ * 
+ */
+
+package org.jhove2.config.spring;
+
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import org.jhove2.core.JHOVE2Exception;
+import org.jhove2.module.format.riff.Chunk;
+import org.jhove2.module.format.riff.ChunkFactory;
+
+/** Spring factory for RIFF chunks.
+ * 
+ * @author slabrams
+ */
+public class SpringChunkFactory
+        implements ChunkFactory
+{
+    /** Map from chunk identifiers to Spring bean names. */
+    protected static ConcurrentMap<String, String> chunkMap;
+
+    /** Get a RIFF chunk based on its identifier.
+     * @param identifier Chunk identifier
+     * @return Chunk
+     * @see org.jhove2.module.format.riff.ChunkFactory#getChunk(java.lang.String)
+     */
+    @Override
+    public Chunk getChunk(String identifier)
+        throws JHOVE2Exception
+    {
+        Chunk chunk = null;
+        String bean = SpringChunkFactory.getChunkMap().get(identifier);
+        if (bean != null) {
+            chunk = SpringConfigInfo.getReportable(Chunk.class, bean);
+        }
+        else {
+            /* Instantiate the generic chunk to handle chunks without
+             * specific classes.
+             */
+            bean = SpringChunkFactory.getChunkMap().get("_J2_");
+            if (bean != null) {
+                chunk = SpringConfigInfo.getReportable(Chunk.class, bean);
+                if (chunk != null) {
+                    chunk.setIdentifier(identifier);
+                }
+            }
+        }
+        return chunk;
+    }  
+
+    /**
+     * Gets the mapping from chunk identifiers to Spring beans. Initializes the
+     * static map on first invocation.
+     * @return Map from chunk identifiers to Spring bean name
+     * @throws JHOVE2Exception
+     */
+    public static ConcurrentMap<String, String> getChunkMap()
+        throws JHOVE2Exception
+    {
+        if (chunkMap == null) {
+            chunkMap = new ConcurrentHashMap<String, String>();
+            
+            /* Use Spring to get instances of all objects inheriting from
+             * GenericChunk.
+             */
+            Map<String, Object> map =
+                SpringConfigInfo.getObjectsForType(Chunk.class);
+            /* For each of the chunk... */
+            for (Entry<String, Object> entry : map.entrySet()) {
+                /* Get the Spring bean name for the chunk. */
+                String bean = entry.getKey();
+                
+                /* Get the chunk identifier. */
+                Chunk chunk = (Chunk) entry.getValue();
+                String identifier = chunk.getIdentifier();
+                
+                /* Add an entry into the identifier-to-bean map */
+                chunkMap.put(identifier, bean);
+            }
+        }
+        return chunkMap;
+    }
+}

File src/main/java/org/jhove2/core/format/Format.java

 	/** Format alias names. */
 	protected Set<String> aliasNames;
 
-	/** Format ambiguity. */
+    /** Format ambiguity. */
 	protected Ambiguity ambiguity;
 
 	/** Format caveats. */
 		this.version = version;
 	}
 
-	@Override
+	/** Determine equality with another format.
+	 * @param obj Format to compared
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	//@Override
 	public boolean equals(Object obj){
 		if (obj==null){
 			return false;
 		Format fObjt = (Format)obj;
 		return this.getIdentifier().equals(fObjt.getIdentifier());
 	}
+
+	/** Compare with another format.
+	 * @param format Format to be compared
+	 */
 	@Override
 	public int compareTo(Format format) {
 		if (format==null){
 		}
 		return this.getIdentifier().compareTo(format.getIdentifier());
 	}
+
+    /** Generate a unique hash code for the format.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((identifier == null) ? 0 : identifier.hashCode());
+        return result;
+    }
 }

File src/main/java/org/jhove2/core/format/FormatIdentification.java

 		}
 	}
 	
+	/** Determine equality with another format identification.
+	 * @param obj Format identification to be compared
+	 */
 	@Override
 	public boolean equals (Object obj){
 		if (obj == null) {
 		equals = this.getConfidence().getOrder()== fiObj.getConfidence().getOrder();
 		return equals;
 	}
-}
+
+    /** Generate a unique has code for the format identification.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((confidence == null) ? 0 : confidence.hashCode());
+        result = prime * result
+                + ((identifier == null) ? 0 : identifier.hashCode());
+        result = prime
+                * result
+                + ((identifierProduct == null) ? 0 : identifierProduct
+                        .hashCode());
+        result = prime
+                * result
+                + ((jhove2Identifier == null) ? 0 : jhove2Identifier.hashCode());
+        return result;
+    }
+ }

File src/main/java/org/jhove2/core/io/AbstractInput.java

 
 package org.jhove2.core.io;
 
+import java.io.BufferedInputStream;
 import java.io.EOFException;
 import java.io.File;
 import java.io.FileInputStream;
 
 	/** Size, in bytes. */
 	protected long fileSize;
+	
+	/** Buffer size, in bytes. */
+	protected int maxBufferSize;
 
 	/**
 	 * Instantiate a new, big-endian <code>AbstractInput</code>.
 	 * @throws IOException
 	 *             I/O exception instantiating input
 	 */
-	public AbstractInput(File file)
+	public AbstractInput(File file, int maxBufferSize)
 	    throws FileNotFoundException, IOException
 	{
-		this(file, ByteOrder.BIG_ENDIAN);
+		this(file, maxBufferSize, ByteOrder.BIG_ENDIAN);
 	}
 
 	/**
 	 * @throws IOException
 	 *             I/O exception instantiating input
 	 */
-	public AbstractInput(File file, ByteOrder order)
+	public AbstractInput(File file, int maxBufferSize, ByteOrder order)
 		throws FileNotFoundException, IOException
 	{
 	    if (!file.isDirectory()) {
 	        this.file = file;
 	        this.byteOrder = order;   
-	        this.stream = (InputStream) new FileInputStream(file);
+	        this.maxBufferSize = maxBufferSize;
+	        this.stream = new BufferedInputStream(new FileInputStream(file),
+	                                              this.maxBufferSize);
 	        this.fileSize = file.length();
 	        this.inputablePosition = 0L;
 
 	 * @see org.jhove2.core.io.Input#getMaxBufferSize()
 	 */
 	@Override
-	public abstract int getMaxBufferSize();
+	public int getMaxBufferSize() {
+	    return this.maxBufferSize;
+	}
 
 	/**
 	 * Get the next buffer's worth of data from the channel.

File src/main/java/org/jhove2/core/io/DirectInput.java

 public class DirectInput
     extends AbstractInput
 {
-	/** Maximum buffer size, in bytes. */
-	protected int maxBufferSize;
-
 	/**
 	 * Instantiate a new, big-endian <code>DirectInput</code> object.
 	 * 
 	public DirectInput(File file, int maxBufferSize, ByteOrder order)
 		throws FileNotFoundException, IOException
 	{
-		super(file, order);
+		super(file, maxBufferSize, order);
 
 		/* Allocate direct buffer and initialize it. */
-		this.maxBufferSize = maxBufferSize;
 		this.buffer =
 		    ByteBuffer.allocateDirect(this.maxBufferSize).order(order);
 		getNextBuffer();
 	}
-
-	/**
-	 * Get maximum buffer size, in bytes.
-	 * 
-	 * @return Maximum buffer size, in bytes
-	 * @see org.jhove2.core.io.Input#getMaxBufferSize()
-	 */
-	@Override
-	public int getMaxBufferSize() {
-		return this.maxBufferSize;
-	}
 }

File src/main/java/org/jhove2/core/io/MappedInput.java

 public class MappedInput
     extends AbstractInput
 {
-	/** Maximum buffer size, in bytes. */
-	protected int maxBufferSize;
-
 	/**
 	 * Instantiate a new, big-endian <code>MappedInput</code> object.
 	 * 
 	public MappedInput(File file, int maxBufferSize, ByteOrder order)
 		throws FileNotFoundException, IOException
 	{
-		super(file, order);
+		super(file, maxBufferSize, order);
 
 		/* Allocate memory mapped buffer and initialize it.
-		*  The buffersize will always be size of file channel size 
+		*  The buffer size will always be size of file channel size.
+		*  Note that this overrides the buffer size used in the superclass
+		*  when creating a buffered input stream from this Input.
 		*/
-		maxBufferSize = (int) this.channel.size();
-		this.maxBufferSize = maxBufferSize;
+		this.maxBufferSize = (int) this.channel.size();
 		this.buffer = (MappedByteBuffer) buffer;
 		/*
 		 * TODO: fix Access Denied problem java.io.IOException: Access is denied
 
 		try {
 			this.buffer = this.channel.map(FileChannel.MapMode.READ_ONLY, 0,
-					maxBufferSize);
+					                       this.maxBufferSize);
 		} catch (IOException e) {
 			e.printStackTrace();
 		}
 		this.bufferOffset = this.channel.position() - buffer.capacity();
 		this.bufferSize = buffer.capacity();
 	}
-
-	/**
-	 * Get maximum buffer size, in bytes.
-	 * 
-	 * @return Maximum buffer size, in bytes
-	 * @see org.jhove2.core.io.Input#getMaxBufferSize()
-	 */
-	@Override
-	public int getMaxBufferSize() {
-		return this.bufferSize;
-	}
 }

File src/main/java/org/jhove2/core/io/NonDirectInput.java

 public class NonDirectInput
     extends AbstractInput
 {
-	/** Maximum buffer size, in bytes. */
-	protected int maxBufferSize;
-
 	/**
 	 * Instantiate a new, big-endian <code>NonDirectInput</code> object.
 	 * 
 	public NonDirectInput(File file, int maxBufferSize, ByteOrder order)
 		throws FileNotFoundException, IOException
 	{
-		super(file, order);
+		super(file, maxBufferSize, order);
 
 		/* Allocate direct buffer and initialize it. */
-		this.maxBufferSize = maxBufferSize;
 		this.buffer = ByteBuffer.allocate(this.maxBufferSize).order(order);
 		getNextBuffer();
 	}
-
-	/**
-	 * Get maximum buffer size, in bytes.
-	 * 
-	 * @return Maximum buffer size, in bytes
-	 * @see org.jhove2.core.io.Input#getMaxBufferSize()
-	 */
-	@Override
-	public int getMaxBufferSize() {
-		return this.maxBufferSize;
-	}
 }

File src/main/java/org/jhove2/core/source/AbstractSource.java

 		return (thisChildSize == containsCount);
 	}
 
-
+    /** Generate unique hash code for the source.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((children == null) ? 0 : children.hashCode());
+        result = prime * result + ((file == null) ? 0 : file.hashCode());
+        result = prime * result + ((modules == null) ? 0 : modules.hashCode());
+        return result;
+    }
 }

File src/main/java/org/jhove2/core/source/URLSource.java

 		return super.equals(obj);
 	}
 	
-	/** Compare to another source unit.
+	/** Generate a unique hash code for the URL source.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((url == null) ? 0 : url.hashCode());
+        return result;
+    }
+    
+    /** Compare to another source unit.
          * @param source
          * @return -1, 0, or 1 if the URL is less than, equals to, or greater than
 	 * the compared URL

File src/main/java/org/jhove2/core/source/ZipDirectorySource.java

 		return this.path;
 	}
 	
+	/** Determine equality with another Zip Directory source.
+	 * @param obj Zip Directory source to be compared
+	 */
 	@Override
 	public boolean equals(Object obj){
 		boolean equals = false;		
 		return super.equals(obj);
 	}
 	
-	@Override
+	/** Generate unique hash code for the Zip Directory source.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + ((comment == null) ? 0 : comment.hashCode());
+        result = prime * result
+                + ((lastModified == null) ? 0 : lastModified.hashCode());
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((path == null) ? 0 : path.hashCode());
+        return result;
+    }
+
+    @Override
 	public int compareTo(Source source){
 		int comp = 0;
 		if (source==null){

File src/main/java/org/jhove2/core/source/ZipFileSource.java

 		return super.equals(obj);
 	}
 	
-	/** Comparison.
+	/** Generate a unique hash code for the Zip File source.
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + ((comment == null) ? 0 : comment.hashCode());
+        result = prime * result + (int) (crc ^ (crc >>> 32));
+        result = prime * result + ((crc32 == null) ? 0 : crc32.hashCode());
+        result = prime * result
+                + ((lastModified == null) ? 0 : lastModified.hashCode());
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((path == null) ? 0 : path.hashCode());
+        result = prime * result + (int) (size ^ (size >>> 32));
+        return result;
+    }
+    
+    /** Comparison.
 	 * @param source Source unit to be compared
 	 * @return Return -1, 0, 1 if the compared source unit collates less than,
 	 *         equal to, or greater than the underlying source unit

File src/main/java/org/jhove2/module/format/riff/ChunkFactory.java

 
 package org.jhove2.module.format.riff;
 
-import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
-import org.jhove2.module.format.riff.field.ChunkClass;
 
 /** RIFF chunk factory.
  * 
  * @author slabrams
  */
-public class ChunkFactory
+public interface ChunkFactory
 {
     /** Get a new chunk based on its identifier.
      * @param identifier Chunk identifier
-     * @param jhove2     JHOVE2 framework
      * @return New chunk
      * @throws JHOVE2Exception 
      */
-    public static GenericChunk getChunk(String identifier, JHOVE2 jhove2)
-        throws JHOVE2Exception
-    {
-        GenericChunk genericChunk = null;
-        
-        ChunkClass cls = ChunkClass.getChunkClass(identifier, jhove2);
-        if (cls != null) {
-            String name = cls.getName();
-            try {
-                Class<?> c = Class.forName(name);
-                genericChunk = (GenericChunk) c.newInstance();
-            }
-            catch (Exception e) {
-                cls = null;
-            }
-        }
-        if (cls == null) {
-            genericChunk = new GenericChunk();
-        }
-        genericChunk.setIdentifier(identifier);
-        
-        return genericChunk;
-    }
-}
+    public Chunk getChunk(String identifier)
+        throws JHOVE2Exception;
+ }

File src/main/java/org/jhove2/module/format/riff/LISTChunk.java

 public class LISTChunk
     extends GenericChunk
 {
+    /** Chunk factory. */
+    protected ChunkFactory chunkFactory;
+    
     /** List type. */
     protected String listType;
     
                 sb.append((char) b);
             }
             consumed += 4;
-            Chunk chunk = ChunkFactory.getChunk(sb.toString(), jhove2);
+            Chunk chunk = this.chunkFactory.getChunk(sb.toString());
             consumed += chunk.parse(jhove2, source, input);
             this.chunks.add(chunk);
             
         return consumed;
     }
     
+    /** Get chunk factory.
+     * @return Chunk factory
+     */
+    public ChunkFactory getChunkFactory() {
+        return this.chunkFactory;
+    }
+    
     /** Get the list type.
      * @return List type
      */
     public String getListType() {
         return this.listType;
     }
+    
+    /** Set chunk factory.
+     * @param factory Chunk factory
+     */
+    public void setChunkFactory(ChunkFactory factory) {
+        this.chunkFactory = factory;
+    }
 }

File src/main/java/org/jhove2/module/format/riff/RIFFChunk.java

 public class RIFFChunk
     extends GenericChunk
 {   
+    /** Chunk factory. */
+    protected ChunkFactory chunkFactory;
+    
     /** RIFF chunk form type in raw form. */
     protected String formType;
     
                 sb.append((char) b);
             }
             consumed += 4;
-            Chunk chunk = ChunkFactory.getChunk(sb.toString(), jhove2);
+            Chunk chunk = this.chunkFactory.getChunk(sb.toString());
             consumed += chunk.parse(jhove2, source, input);
             this.chunks.add(chunk);
             
 
         return consumed;
     }
-      
+    
+    /** Get chunk factory.
+     * @return Chunk factory
+     */
+    public ChunkFactory getChunkFactory() {
+        return this.chunkFactory;
+    }
+    
     /** Get RIFF chunk form type in descriptive form.
      * @return RIFF chunk form type
      */
     public Message getInvalidFormTypeMessage() {
         return this.invalidFormTypeMessage;
     }
+    
+    /** Set chunk factory.
+     * @param factory Chunk factory
+     */
+    public void setChunkFactory(ChunkFactory factory) {
+        this.chunkFactory = factory;
+    }
 }

File src/main/java/org/jhove2/module/format/tiff/IFD.java

 import org.jhove2.core.Message;
 import org.jhove2.core.Message.Context;
 import org.jhove2.core.Message.Severity;
+import org.jhove2.core.format.Format;
 import org.jhove2.core.io.Input;
 import org.jhove2.core.reportable.AbstractReportable;
 import org.jhove2.core.source.Source;
      *             If an I/O exception is raised reading the source unit
      * @throws JHOVE2Exception
      */
-    public void parse(JHOVE2 jhove2, Source source, Input input) throws EOFException,
-    IOException, JHOVE2Exception {
-
+    public void parse(JHOVE2 jhove2, Source source, Input input,
+                      Map<Integer, Format> tagToFormatMap)
+        throws EOFException, IOException, JHOVE2Exception
+    {
         this.isValid = Validity.Undetermined;
         long offsetInIFD = this.offset;
         this.nextIFD = 0L;
             
             for (int i=0; i<this.numEntries; i++) {
                 IFDEntry ifdEntry = new IFDEntry();
-                ifdEntry.parse(jhove2, source, input);
+                ifdEntry.parse(jhove2, source, input, tagToFormatMap);
                 Validity validity = ifdEntry.isValid();
                 if (validity != Validity.True) {
                     this.isValid = validity;

File src/main/java/org/jhove2/module/format/tiff/IFDEntry.java

 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
 import org.jhove2.annotation.ReportableProperty;
 import org.jhove2.annotation.ReportableProperty.PropertyType;
-import org.jhove2.config.spring.SpringConfigInfo;
 import org.jhove2.core.I8R;
 import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
 import org.jhove2.core.Message;
 import org.jhove2.core.Message.Context;
 import org.jhove2.core.Message.Severity;
+import org.jhove2.core.format.Format;
 import org.jhove2.core.format.FormatIdentification;
 import org.jhove2.core.format.FormatIdentification.Confidence;
 import org.jhove2.core.io.Input;
      * parse the IFD Entry 
      * @throws IOException, JHOVE2Exception 
      */
-    public void parse(JHOVE2 jhove2, Source source, Input input) throws IOException, JHOVE2Exception{
+    public void parse(JHOVE2 jhove2, Source source, Input input,
+                      Map<Integer, Format> tagToFormatMap)
+        throws IOException, JHOVE2Exception
+    {
         this.isValid = Validity.True;
         this.tag = input.readUnsignedShort();
         if (tag > prevTag)
             if (isValidTag(jhove2)) {
                 /* Handle tags which require unique processing of their values */
 
-                /* Parse the ICCProfile tag */
-                if (this.tag == TiffIFD.ICCPROFILE) {
+                /* Parse the ICCProfile or XMP tag */
+                if (this.tag == TiffIFD.ICCPROFILE ||
+                    this.tag == TiffIFD.XMP) {
                     ByteStreamSource bss = new ByteStreamSource(jhove2, source, this.valueOffset, this.count);
-                    Map<String, Object> i8r = SpringConfigInfo.getObjectsForType(I8R.class);
-                    I8R identifier = (I8R) i8r.get("ICCIdentifier");
-                    FormatIdentification iccPresumptiveFormat = new FormatIdentification(identifier, Confidence.PositiveSpecific); 
-                    bss.addPresumptiveFormat(iccPresumptiveFormat);
+                    Format format = tagToFormatMap.get(this.tag);
+                    I8R identifier = format.getIdentifier();
+                    FormatIdentification presumptiveFormat = new FormatIdentification(identifier, Confidence.PositiveSpecific); 
+                    bss.addPresumptiveFormat(presumptiveFormat);
                     jhove2.characterize(bss, input);
                 }
-                /* Parse the XMP tag */
-                else if (this.tag == TiffIFD.XMP) {
-                    ByteStreamSource bss = new ByteStreamSource(jhove2, source, this.valueOffset, this.count);
-                    Map<String, Object> i8r = SpringConfigInfo.getObjectsForType(I8R.class);
-                    I8R identifier = (I8R) i8r.get("XmlIdentifier");
-                    FormatIdentification xmlPresumptiveFormat = new FormatIdentification(identifier, Confidence.PositiveGeneric); 
-                    bss.addPresumptiveFormat(xmlPresumptiveFormat);
-                    jhove2.characterize(bss, input);                
-                }
                 else if (this.tag == TiffIFD.STRIPBYTECOUNTS || this.tag == TiffIFD.STRIPOFFSETS) {
                     input.setPosition(this.valueOffset);
                     this.isArray = true;

File src/main/java/org/jhove2/module/format/tiff/TiffModule.java

 import java.nio.ByteOrder;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jhove2.annotation.ReportableProperty;
-import org.jhove2.core.Invocation;
 import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
 import org.jhove2.core.Message;
 import org.jhove2.core.source.Source;
 import org.jhove2.module.format.BaseFormatModule;
 import org.jhove2.module.format.Validator;
-import org.jhove2.module.format.Validator.Validity;
 
 /**
  * JHOVE2 TIFF module. This module parses a TIFF instance and captures selected
     /** The Source object passed in by the parse method */
     protected  Source source;
 
+    /** Map from tags to formats for the content of the tags. */
+    public Map<Integer, Format> tagToFormatMap;
+    
     /**
      * Instantiate a new <code>TIFFModule</code>.
      * 
     public TiffModule(Format format) {
         super(VERSION, RELEASE, RIGHTS, format);
         this.validity = Validity.Undetermined;
+        
+        this.tagToFormatMap = new ConcurrentHashMap<Integer, Format>();
     }
     
     public TiffModule() {
         ifd.setOffset(ifdOffset);
 
         /* parse for the appropriate IFD type */
-        ifd.parse(jhove2, source, input);
+        ifd.parse(jhove2, source, input, this.tagToFormatMap);
 
         if (ifdList.size () == 0) {
             ifd.setFirst (true);
         return this.version;
     }
 
+    /** Set the tag-to-format map.
+     * @param map Tag-to-format map
+     */
+    public void setTagToFormatMap(Map<Integer, Format> map) {
+        this.tagToFormatMap = map;
+    }
 }

File src/main/java/org/jhove2/module/format/wave/WAVEModule.java

     /** Module validation coverage. */
     public static final Coverage COVERAGE = Coverage.Inclusive;
   
+    /** Chunk factory. */
+    protected ChunkFactory chunkFactory;
+    
     /** WAVE chunks. */
     protected List<Chunk> chunks;
     
             short b = input.readUnsignedByte();
             sb.append((char) b);
         }
-        Chunk chunk = ChunkFactory.getChunk(sb.toString(), jhove2);
+        Chunk chunk = this.chunkFactory.getChunk(sb.toString());
         consumed += chunk.parse(jhove2, source, input);
         this.chunks.add(chunk);
 
         }
         return this.isValid();
     }
+    
+    /** Get chunk factory.
+     * @return Chunk factory
+     */
+    public ChunkFactory getChunkFactory() {
+        return this.chunkFactory;
+    }
 
     /** Get chunks.
      * @return Chunks
     {
         return this.isValid;
     }
+    
+    /** Set chunk factory.
+     * @param factory Chunk factory
+     */
+    public void setChunkFactory(ChunkFactory factory) {
+        this.chunkFactory = factory;
+    }
 }

File src/main/java/org/jhove2/module/format/wave/XMPChunk.java

 
 import java.io.EOFException;
 import java.io.IOException;
-import java.util.Map;
-import org.jhove2.config.spring.SpringConfigInfo;
 import org.jhove2.core.I8R;
 import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
+import org.jhove2.core.format.Format;
 import org.jhove2.core.format.FormatIdentification;
 import org.jhove2.core.format.FormatIdentification.Confidence;
 import org.jhove2.core.io.Input;
 public class XMPChunk
     extends GenericChunk
 {
-    /** Instantiate a new <code>XMPChunk</code>. */
-    public XMPChunk() {
+    /** XML format. */
+    protected Format xmlFormat;
+    
+    /** Instantiate a new <code>XMPChunk</code>.
+     * @param xml XML format
+     */
+    public XMPChunk(Format xml) {
         super();
+        
+        this.xmlFormat = xml;
     }
     
     /** 
         /* The chunk contents are in XML; invoke the XML module. */
         ByteStreamSource child =
             new ByteStreamSource(jhove2, source, input.getPosition(), this.size);
-        Map<String, Object> i8r = SpringConfigInfo.getObjectsForType(I8R.class);
-        I8R xml = (I8R) i8r.get("XmlIdentifier");;
+        I8R xml = xmlFormat.getIdentifier();
         FormatIdentification id = new FormatIdentification(xml, Confidence.PositiveGeneric);
         child.addPresumptiveFormat(id);
         jhove2.characterize(child, input);      

File src/main/java/org/jhove2/module/format/wave/bwf/AXMLChunk.java

 
 import java.io.EOFException;
 import java.io.IOException;
-import java.util.Map;
-import org.jhove2.config.spring.SpringConfigInfo;
 import org.jhove2.core.I8R;
 import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
+import org.jhove2.core.format.Format;
 import org.jhove2.core.format.FormatIdentification;
 import org.jhove2.core.format.FormatIdentification.Confidence;
 import org.jhove2.core.io.Input;
 public class AXMLChunk
     extends GenericChunk
 {
-    /** Instantiate a new <code>AXMLChunk</code>. */
-    public AXMLChunk()
+    /** XML format. */
+    protected Format xmlFormat;
+    
+    /** Instantiate a new <code>AXMLChunk</code>.
+     * @param xml XML format
+     */
+    public AXMLChunk(Format xml)
     {
         super();
+        
+        this.xmlFormat = xml;
     }
     
     /** Parse an AXML chunk.
         /* The chunk contents are in XML; invoke the XML module. */
         ByteStreamSource child =
             new ByteStreamSource(jhove2, source, input.getPosition(), this.size);
-        Map<String, Object> i8r = SpringConfigInfo.getObjectsForType(I8R.class);
-        I8R xml = (I8R) i8r.get("XmlIdentifier");;
+        I8R xml = xmlFormat.getIdentifier();
         FormatIdentification id = new FormatIdentification(xml, Confidence.PositiveGeneric);
         child.addPresumptiveFormat(id);
         jhove2.characterize(child, input);      
         
         return consumed;
     }
+    
+    /** Get XML format.
+     * @return XML format
+     */
+    public Format getXMLFormat() {
+        return this.xmlFormat;
+    }
 }

File src/main/java/org/jhove2/module/format/wave/bwf/BroadcastWaveFormatProfile.java

         if (this.isValid == Validity.False) {
             this.baselineWAVEFormatIsInvalidMessage = new Message(Severity.ERROR,
                     Context.OBJECT,
-                    "org.jhove2.module.format.wave.bwf.baselineWAVEForamtIsInvalid",
+                    "org.jhove2.module.format.wave.bwf.BroadcastWaveFormatProfile.baselineWAVEFormatIsInvalid",
                     jhove2.getConfigInfo());
         }
         

File src/main/java/org/jhove2/module/format/wave/bwf/IXMLChunk.java

 
 import java.io.EOFException;
 import java.io.IOException;
-import java.util.Map;
-import org.jhove2.config.spring.SpringConfigInfo;
 import org.jhove2.core.I8R;
 import org.jhove2.core.JHOVE2;
 import org.jhove2.core.JHOVE2Exception;
+import org.jhove2.core.format.Format;
 import org.jhove2.core.format.FormatIdentification;
 import org.jhove2.core.format.FormatIdentification.Confidence;
 import org.jhove2.core.io.Input;
 public class IXMLChunk
         extends GenericChunk
 {
-    /** Instantiate a new <code>IXMLChunk</code>. */
-    protected IXMLChunk() {
+    /** XML format. */
+    protected Format xmlFormat;
+    
+    /** Instantiate a new <code>IXMLChunk</code>.
+     * @param xml XML format 
+     */
+    protected IXMLChunk(Format xml) {
         super();
+        
+        this.xmlFormat = xml;
     }
     
     /** Parse an iXML chunk.
         /* The chunk contents are in XML; invoke the XML module. */
         ByteStreamSource child =
             new ByteStreamSource(jhove2, source, input.getPosition(), this.size);
-        Map<String, Object> i8r = SpringConfigInfo.getObjectsForType(I8R.class);
-        I8R xml = (I8R) i8r.get("XmlIdentifier");;
+        I8R xml = xmlFormat.getIdentifier();
         FormatIdentification id = new FormatIdentification(xml, Confidence.PositiveGeneric);
         child.addPresumptiveFormat(id);
         source.addChildSource(child);