|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler project35.io.Project35DataFileReader
public class Project35DataFileReader
this reads a project35 data file, whether that file is a final format submission file or whether it is a .pdr file contained in the native .pdz file format. It also can read template files, which is a saved portion of a file that can be used by multiple files. The main distinction between data files and template files is that templates always start with the ... tag and the data files will start with a top level tag that matches the "topLevelElement" expected by the current schema. (Note that the expected top level record type is defined in the configuration * file.
When the reader reads the file, it verifies that the schema stamp written into the data matches the schema currently being used by Project35. in this case it is sufficient that the schema in the file ends with the same .xsd file used by the tool. This class is part of the new system for reading the project35 data file format. for more information about this, please check the architecture document that comes with the release.Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.
Field Summary | |
---|---|
protected IDGeneratorService |
idGeneratorService
used to register id values assigned to xs:id fields in a record model |
protected java.util.Hashtable |
modelFromID
this records xs:id identifier --> record model references. |
protected java.io.OutputStreamWriter |
out
|
Constructor Summary | |
---|---|
Project35DataFileReader(Project35FormContext project35FormContext,
boolean readTemplate)
|
Method Summary | |
---|---|
void |
characters(char[] tagData,
int start,
int length)
|
protected void |
clearRecordIDRegistry()
clears the registry that associates ID values with model objects |
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
RecordModel |
getRootModel()
|
void |
ignoreTopLevelElementCheck()
|
void |
omitModelStamp()
causes Project35 to ignore whether there is a match between the model stamp in the file and the model stamp used by the application |
protected void |
populateModelWithAttributeValues(RecordModel recordModel,
org.xml.sax.Attributes attributes)
tries to match the attributes found in the tag of a record model to either edit field values or references |
void |
registerIDFields(RecordModel recordModel)
registers the identifiers used by the record's xs:id fields to be excluded as possible values for keys generated by the service in the future. |
void |
resolveIDREFS(java.lang.Object recordObject)
recurvisely goes through the model tree and tries to replace the ID value held by each reference with an actual record model. |
void |
setIDGeneratorService(IDGeneratorService idGeneratorService)
sets the ID Generator service which picks up identifiers that have already been used in recorded records. |
void |
startDocument()
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable modelFromID
protected IDGeneratorService idGeneratorService
protected java.io.OutputStreamWriter out
Constructor Detail |
---|
public Project35DataFileReader(Project35FormContext project35FormContext, boolean readTemplate)
Method Detail |
---|
public RecordModel getRootModel()
public void ignoreTopLevelElementCheck()
public void omitModelStamp()
public void setIDGeneratorService(IDGeneratorService idGeneratorService)
idGeneratorService
- the service that is used to generate values for
identifier fields in record model instances.public void resolveIDREFS(java.lang.Object recordObject)
protected void clearRecordIDRegistry()
public void registerIDFields(RecordModel recordModel)
protected void populateModelWithAttributeValues(RecordModel recordModel, org.xml.sax.Attributes attributes)
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] tagData, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |