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
A SAX-based handler to collect the frequency of occurences of properties
of information items in one or more infosets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FrequencySet
<QName> private FrequencySet
<String> private FrequencySet
<QName> private FrequencySet
<String> private FrequencySet
<String> private StringBuilder
private char
private FrequencySet
<String> private FrequencySet
<String> -
Constructor Summary
ConstructorsConstructorDescriptionThe default frequency handler.A frequency handler initiated with information generated from aSchemaProcessor
. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
void
void
void
private void
private QName
createQName
(String uri, String localName, String qName) void
Generate qualified names that have not been processed.private void
generateQNamesWithPrefix
(Map<String, Set<QName>> m, FrequencySet<QName> fhm, Map<String, String> namespaceURIToPrefix) getLists()
Deprecated.private String
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
namespacesToElements
-
namespacesToAttributes
-
namespaceURIToPrefix
-
prefixes
-
namespaces
-
localNames
-
elements
-
attributes
-
attributeValues
-
textContentValues
-
prefixBuilder
-
prefixCharacter
private char prefixCharacter
-
-
Constructor Details
-
FrequencyHandler
public FrequencyHandler()The default frequency handler. -
FrequencyHandler
A frequency handler initiated with information generated from aSchemaProcessor
.- Parameters:
sp
- the schema processor.
-
-
Method Details
-
addXsiAttributes
public void addXsiAttributes() -
addQNameToElements
-
addQNameToAttributes
-
getLists
Deprecated.Get the frequency based lists of properties of information items.- Returns:
- the frequency based lists.
-
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
-
addAll
-
bucketQNamesToNamespace
-
startPrefixMapping
- 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
-
addQName
-
createQName
-
generateQNamesWithPrefix
-
getNewPrefix
-