Class TagHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class TagHandler
    extends org.xml.sax.helpers.DefaultHandler
    Extension of PathQueryHandler to handle parsing TemplateQueries
    Author:
    Xavier Watkins
    • Constructor Summary

      Constructors 
      Constructor Description
      TagHandler​(java.lang.String userName, java.util.Set tags)
      Constructor
      TagHandler​(ProfileManager profileManager, java.lang.String userName)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void endElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName)
      int getCount()
      Return a count of the number of tags read.
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TagHandler

        public TagHandler​(java.lang.String userName,
                          java.util.Set tags)
        Constructor
        Parameters:
        userName - the name of the user whose profile is being read
        tags - will be populated with any tags to add to the target profile
      • TagHandler

        public TagHandler​(ProfileManager profileManager,
                          java.lang.String userName)
        Constructor
        Parameters:
        profileManager - add each Tag using this ProfileManager
        userName - the name of the user whose profile is being read
    • Method Detail

      • startElement

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

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • getCount

        public int getCount()
        Return a count of the number of tags read.
        Returns:
        the number of tags read