Package com.sun.xml.analysis.frequency
Class FrequencyHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.sun.xml.analysis.frequency.FrequencyHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class FrequencyHandler extends 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
Constructors Constructor Description FrequencyHandler()
The default frequency handler.FrequencyHandler(SchemaProcessor sp)
A frequency handler initiated with information generated from aSchemaProcessor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 vocabularyvoid
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
-
-
-
-
Constructor Detail
-
FrequencyHandler
public FrequencyHandler()
The default frequency handler.
-
FrequencyHandler
public FrequencyHandler(SchemaProcessor sp)
A frequency handler initiated with information generated from aSchemaProcessor
.- 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.
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
-