org.rddl.sax
Class RDDLFilter

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--org.rddl.sax.RDDLFilter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class RDDLFilter
extends org.xml.sax.helpers.XMLFilterImpl


Field Summary
protected  boolean bRDDLNamespace
           
protected  java.net.URLConnection connection
           
protected  boolean containers
           
 java.lang.String contentURI
          contentURI
protected  java.lang.String m_contentType
           
protected  java.lang.String m_userAgent
           
protected  Namespace namespace
           
 java.lang.String namespaceURI
          namespaceURI
 
Constructor Summary
RDDLFilter()
           
 
Method Summary
 java.net.URLConnection getConnection()
          getConnection
 Namespace getNamespace()
           
 Resource getResource(java.lang.String nature, java.lang.String purpose)
          Algorithm for obtaining resource is roughly:
 void parse(org.xml.sax.InputSource insrc)
           
 void parse(java.lang.String nsURI)
           
 void setContentType(java.lang.String val)
           
 void setFeature(java.lang.String feature, boolean flag)
           
 void setUserAgent(java.lang.String val)
           
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setParent, setProperty, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceURI

public java.lang.String namespaceURI

namespaceURI

The URI of the namespace we are resolving


contentURI

public java.lang.String contentURI

contentURI

The URI of the root element of the resolved document.


bRDDLNamespace

protected boolean bRDDLNamespace

connection

protected java.net.URLConnection connection

m_contentType

protected java.lang.String m_contentType

m_userAgent

protected java.lang.String m_userAgent

namespace

protected Namespace namespace

containers

protected boolean containers
Constructor Detail

RDDLFilter

public RDDLFilter()
Method Detail

getNamespace

public Namespace getNamespace()

getConnection

public java.net.URLConnection getConnection()
                                     throws java.net.MalformedURLException,
                                            java.io.IOException

getConnection

A helper class to build an HTTP request of the namespace URI.

Parameters:
userAgent - an optional user-agent
contentType - an optional content-type for an accept header

getResource

public Resource getResource(java.lang.String nature,
                            java.lang.String purpose)
                     throws AmbiguousMappingException,
                            java.io.IOException,
                            org.xml.sax.SAXException

Algorithm for obtaining resource is roughly:

-If this is a RDDL namespace return resource of arcrole. Well known arcroles are mapped to root namespace of resource.

-If this is a non-RDDL namespace, and if arcrole == root namespace URI return resource. If this provides no result match arcrole to content-type

Parameters:
arcrole -  
Throws:
AmbiguousMappingException - -- more than one resource uses this arcrole

parse

public void parse(java.lang.String nsURI)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Overrides:
parse in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
nsURI - a namespace URI to parse as RDDL if possible

parse

public void parse(org.xml.sax.InputSource insrc)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Overrides:
parse in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
insrc - An InputSource to parse as RDDL if possible

setFeature

public void setFeature(java.lang.String feature,
                       boolean flag)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Overrides:
setFeature in class org.xml.sax.helpers.XMLFilterImpl

setContentType

public void setContentType(java.lang.String val)

setUserAgent

public void setUserAgent(java.lang.String val)