com.sun.xml.analysis.frequency
Class FrequencyHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.sun.xml.analysis.frequency.FrequencyHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class FrequencyHandler
extends org.xml.sax.helpers.DefaultHandler

A SAX-based handler to collect the frequency of occurences of properties of information items in one or more infosets.

Author:
Paul.Sandoz@Sun.Com

Constructor Summary
FrequencyHandler()
          The default frequency handler.
FrequencyHandler(SchemaProcessor sp)
          A frequency handler initiated with information generated from a SchemaProcessor.
 
Method Summary
 void addQNameToAttributes(QName q)
           
 void addQNameToElements(QName q)
           
 void addXsiAttributes()
           
 void generateQNamesWithPrefix()
          Generate qualified names that have not been processed.
 FrequencyBasedLists getLists()
          Deprecated.  
 Map<String,String> getNamespaceURIToPrefixMap()
           
 Vocabulary getVocabulary()
          Get the vocabulary
 void startElement(String uri, String localName, String qName, Attributes atts)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrequencyHandler

public FrequencyHandler()
The default frequency handler.


FrequencyHandler

public FrequencyHandler(SchemaProcessor sp)
A frequency handler initiated with information generated from a SchemaProcessor.

Parameters:
sp - the schema processor.
Method Detail

addXsiAttributes

public void addXsiAttributes()

addQNameToElements

public void addQNameToElements(QName q)

addQNameToAttributes

public void addQNameToAttributes(QName q)

getLists

public FrequencyBasedLists getLists()
Deprecated. 

Get the frequency based lists of properties of information items.

Returns:
the frequency based lists.

getVocabulary

public Vocabulary getVocabulary()
Get the vocabulary

Returns:
the vocabulary.

generateQNamesWithPrefix

public void generateQNamesWithPrefix()
Generate qualified names that have not been processed.

Prefixes are automatically chosen.

TODO: check for clashes with prefixes generated and prefixes that have already occured.


getNamespaceURIToPrefixMap

public Map<String,String> getNamespaceURIToPrefixMap()

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException


Copyright © 2012 Oracle Corpration. All Rights Reserved.