public class SaxReaderImpl extends SaxEntityImpl implements SaxReader
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SaxReaderImpl.FileInputStreamWrapper
Special wrapper to wrap read from file in lazy mode.
|
private static class |
SaxReaderImpl.LongcharInputStream
Special wrapper to wrap read from longchar in lazy mode.
|
(package private) static class |
SaxReaderImpl.MemptrInputStream
Special wrapper to wrap read from memptr in lazy mode.
|
SaxReader.ReadStatus
Modifier and Type | Field and Description |
---|---|
private javax.xml.stream.util.XMLEventAllocator |
allocator
helps XMLStreamReader to allocate xml events
|
private XMLCallbackWrapper |
callbackWrapper
Special wrapper to call callback procedures
|
private handle |
hCallback
Specify the location of the SAX callback procedures
|
private java.io.InputStream |
inputStream
Current input source of SAX-Reader
|
private static java.util.logging.Logger |
LOG
Anonymous log instance.
|
private java.lang.String |
noNameSchemaLocation
No name Schema location variable
|
private SaxReader.ReadStatus |
readStatus
Current status of SAX-Writer
|
private org.codehaus.stax2.XMLStreamReader2 |
saxParser
Sax-parser object
|
private java.lang.String |
schemaLocation
Schema locations variable
|
private java.lang.String |
schemaPaths
Schema path location variable
|
private boolean |
suppress
Indicates if the namespace processing is suppressed or not.
|
private boolean |
validate
Indicates if the parser validates the XML document against DTD or not.
|
isValid
name, nextSibling, prevSibling
instProc
SAX_COMPLETE, SAX_PARSER_ERROR, SAX_RUNNING, SAX_UNINITIALIZED
Constructor and Description |
---|
SaxReaderImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addValidation()
Add schema validation if it's specified.
|
private static java.io.InputStream |
findSchemaInPath(java.lang.String workPath,
java.lang.String systemID,
java.lang.String baseURI)
Find DTD in path.
|
handle |
getHandler()
Gets the value of the handler atribute for the given SAX Reader object.
|
private static java.io.InputStream |
getInputStream(java.lang.String fileName,
java.io.File path)
Find fileName.
|
integer |
getLocatorColumnNumber()
Gets the value of the current 1-based column in XML source.
|
integer |
getLocatorLineNumber()
Gets the value of the current 1-based line number in XML source.
|
character |
getLocatorPublicId()
Gets the current value of the public identifier of the current XML source.
|
character |
getLocatorSystemId()
Gets the current value of the system identifier of the current XML source.
|
character |
getNonamespaceSchemaLocation()
Gets the value of the XML schema file for elements with no namespaces.
|
integer |
getParseStatus()
Gets the current value of the parse status.
|
character |
getSchemaLocation()
Gets the current value of the namespace location pair mapping.
|
character |
getSchemaPath()
Gets the delimiter separated list of directory paths used to locate XML DTD associated with
a particular XML document.
|
logical |
getSuppressNamespaceProcessing()
Indicates if the namespace processing is suppressed or not.
|
logical |
getValidationEnabled()
Indicates if the parser validates the XML document against DTD or not.
|
private javax.xml.stream.events.XMLEvent |
getXMLEvent(javax.xml.stream.XMLStreamReader reader)
This method allocates an event given the current state of the XMLStreamReader
|
private void |
mismatchCallbackNumberParameters(java.lang.String callbackName)
Process and display mismatched parameters in callback.
|
private void |
mismatchCallbackParameters(java.lang.String method,
java.lang.String callbackName)
Process and display mismatched parameters in callback.
|
protected boolean |
resourceDelete()
Delete the resource.
|
void |
saxParse()
Executing single call parse of an XML document associated with a SAX-Reader object.
|
private static void |
saxParseError(java.lang.String method,
java.lang.String message)
Process and display mismatched parameters in callback.
|
void |
saxParseFirst()
Initializes and begins progressive-scan parse of an XML document associated with a
SAX-Reader object.
|
void |
saxParseNext()
Continues progressive-scan parse of an XML document associated with a SAX-Reader object.
|
void |
setHandler(handle hCallback)
Sets the value of the handler atribute for the given SAX Reader object.
|
logical |
setInputSource(character mode,
java.lang.Object source)
Specifies the input source of the XML document to be parsed by a SAX-Reader object.
|
logical |
setInputSource(java.lang.String mode,
java.lang.Object sourceObject)
Specifies the input source of the XML document to be parsed by a SAX-Reader object.
|
void |
setNonamespaceSchemaLocation(character location)
Setting the new value for the nonamespace-schema-location attribute.
|
void |
setSchemaLocation(character location)
Sets the current value of the namespace location pair mapping.
|
void |
setSchemaLocation(java.lang.String location)
Sets the current value of the namespace location pair mapping.
|
void |
setSchemaPath(character path)
Sets the delimiter separated list of directory paths used to locate XML DTD associated with
a particular XML document.
|
void |
setSchemaPaths(java.lang.String path)
Sets the delimiter separated list of directory paths used to locate XML DTD associated with
a particular XML document.
|
void |
setSuppressNamespaceProcessing(boolean suppress)
Redefines whether the namespace processing is suppressed or not.
|
void |
setSuppressNamespaceProcessing(logical suppress)
Redefines whether the namespace processing is suppressed or not.
|
void |
setValidationEnabled(boolean enable)
Redefines whether the parser will validate the XML document against DTD or not.
|
void |
setValidationEnabled(logical enable)
Redefines whether the parser will validate the XML document against DTD or not.
|
logical |
stopParsing()
Causes parser to stop parsing the XML document.
|
getADMData, getUniqueID, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, invalidReadWriteModeError, invalidStatusAttributeError, invalidStatusMethodError, removeAttribute, removeAttribute, setADMData, setADMData, writerOutputError
addSchemaLocation, addSchemaLocation, addSchemaLocation, addSchemaLocation, hasNextSibling, hasPrevSibling, invalidArgumentAssignError, invalidArgumentError, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocation, valid
delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameReadOnly, hasParent, hasPrivateData, interlink, isChained, lastResource, lastResource, name, name, name, readOnlyError, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData
getResourceType, id, id, implicitDeletion, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertAttribute
addSchemaLocation, addSchemaLocation, addSchemaLocation, addSchemaLocation, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocation
id, id, unknown, valid
getUniqueID
getADMData, setADMData, setADMData
getResourceType
private static final java.util.logging.Logger LOG
private SaxReader.ReadStatus readStatus
private java.io.InputStream inputStream
private org.codehaus.stax2.XMLStreamReader2 saxParser
private javax.xml.stream.util.XMLEventAllocator allocator
private XMLCallbackWrapper callbackWrapper
private handle hCallback
private boolean validate
private boolean suppress
private java.lang.String schemaPaths
private java.lang.String schemaLocation
private java.lang.String noNameSchemaLocation
private static java.io.InputStream findSchemaInPath(java.lang.String workPath, java.lang.String systemID, java.lang.String baseURI)
workPath
- File path or directory. May be relative path. This path is specify in 4gl
SCHEMA-PATH attribute.systemID
- DTD schema filename.baseURI
- Working directory. May used if workPath is not absolute path.private static java.io.InputStream getInputStream(java.lang.String fileName, java.io.File path)
fileName
- File to findpath
- May be file which method is try to find or directory in which need to find file.public handle getHandler()
getHandler
in interface SaxReader
public void setHandler(handle hCallback)
setHandler
in interface SaxReader
hCallback
- The handle of the new callback handler to be set for the handler attribute.public integer getLocatorColumnNumber()
getLocatorColumnNumber
in interface SaxReader
public integer getLocatorLineNumber()
getLocatorLineNumber
in interface SaxReader
public character getLocatorPublicId()
getLocatorPublicId
in interface SaxReader
public character getLocatorSystemId()
getLocatorSystemId
in interface SaxReader
public integer getParseStatus()
SaxReader.ReadStatus.SAX_UNINITIALIZED
. The other returned values are
SaxReader.ReadStatus.SAX_COMPLETE
,
SaxReader.ReadStatus.SAX_PARSER_ERROR
or SaxReader.ReadStatus.SAX_RUNNING
.getParseStatus
in interface SaxReader
public character getSchemaLocation()
getSchemaLocation
in interface XmlSchema
public void setSchemaLocation(java.lang.String location)
setSchemaLocation
in interface SaxReader
location
- The new value the current schema-location attribute.public character getSchemaPath()
getSchemaPath
in interface XmlSchema
public void setSchemaPaths(java.lang.String path)
setSchemaPaths
in interface SaxReader
path
- The new value the current schema-path attribute.public logical getSuppressNamespaceProcessing()
getSuppressNamespaceProcessing
in interface XmlSchema
public void setSuppressNamespaceProcessing(boolean suppress)
setSuppressNamespaceProcessing
in interface XmlSchema
suppress
- The new value the current suppress-namespace-processing attribute.public logical getValidationEnabled()
getValidationEnabled
in interface SaxReader
public void setValidationEnabled(boolean enable)
setValidationEnabled
in interface SaxReader
enable
- The new value the current validation-enabled attribute.public void saxParse()
public void saxParseFirst()
saxParseFirst
in interface SaxReader
public void saxParseNext()
saxParseNext
in interface SaxReader
public logical setInputSource(java.lang.String mode, java.lang.Object sourceObject)
setInputSource
in interface SaxReader
mode
- The type of the object to process. Can be 'FILE', 'HANDLE', 'MEMPTR' or
'LONGCHAR'.sourceObject
- The appropriate object to process.true
in case of success false
otherwise.public logical setInputSource(character mode, java.lang.Object source)
setInputSource
in interface SaxReader
mode
- The type of the object to process. Can be 'FILE', 'HANDLE', 'MEMPTR' or
'LONGCHAR'.source
- The appropriate object to process.true
in case of success false
otherwise.public void setSchemaLocation(character location)
setSchemaLocation
in interface XmlSchema
location
- The new value the current schema-location attribute.public void setSchemaPath(character path)
setSchemaPath
in interface XmlSchema
path
- The new value the current schema-path attribute.public character getNonamespaceSchemaLocation()
getNonamespaceSchemaLocation
in interface XCommon
getNonamespaceSchemaLocation
in class XCommonImpl
public void setNonamespaceSchemaLocation(character location)
setNonamespaceSchemaLocation
in interface XCommon
setNonamespaceSchemaLocation
in class XCommonImpl
location
- New value of the nonamespace-schema-location attribute to set.public void setSuppressNamespaceProcessing(logical suppress)
setSuppressNamespaceProcessing
in interface XmlSchema
suppress
- The new value the current suppress-namespace-processing attribute.public void setValidationEnabled(logical enable)
setValidationEnabled
in interface SaxReader
enable
- The new value the current validation-enabled attribute.public logical stopParsing()
stopParsing
in interface SaxReader
true
in case of success false
otherwise.protected boolean resourceDelete()
resourceDelete
in class XCommonImpl
true
if the resource was deleted.private static void saxParseError(java.lang.String method, java.lang.String message)
method
- The read-only attribute.message
- Additional error message.private void addValidation() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
- if the schema file is incorrect or contend of file is invalid.private javax.xml.stream.events.XMLEvent getXMLEvent(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- The XMLStreamReader to allocate fromjavax.xml.stream.XMLStreamException
- In case of I/O errors.private void mismatchCallbackParameters(java.lang.String method, java.lang.String callbackName)
method
- The read-only attribute.callbackName
- The name of callback.private void mismatchCallbackNumberParameters(java.lang.String callbackName)
callbackName
- name of callback.