hr.fer.tel.nims.dsa.client.clientprofilehandler
Class ProfileParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by hr.fer.tel.nims.dsa.client.clientprofilehandler.ProfileParser
All Implemented Interfaces:
ProfileInterface, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ProfileParser
extends org.xml.sax.helpers.DefaultHandler
implements ProfileInterface

ProfileManager is used to parse and modify client, service or final profiles

Author:
Mirko Suznjevic

Constructor Summary
ProfileParser()
           
 
Method Summary
 java.lang.String addParameters(java.lang.String source, XmlElement existingTag, java.util.LinkedList insertingTags)
          adds parameters from insertingTags list to the profile in the existingTag element
 void characters(char[] buf, int offset, int len)
          handles the characthers event of the SAX parser
 java.lang.String editParameters(java.lang.String source, XmlElement existingTag, XmlElement newTag)
          edits parameters of existing tag and sets them to match new tag element
 void endDocument()
          handles the end document event of the SAX parser
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          handles the end element event of the SAX parser
 java.lang.String getParameter(java.lang.String source, XmlElement existingTag)
          returns requested existing tag
 java.lang.String getParameterValue(java.lang.String source, XmlElement existingTag)
          returns requested existing tags value
 void startDocument()
          handles the start document event of the SAX parser
 void startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs)
          handles the start element event of the SAX parser
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileParser

public ProfileParser()
Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
handles the start document event of the SAX parser

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
handles the end document event of the SAX parser

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String lName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
handles the start element event of the SAX parser

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 namespaceURI,
                       java.lang.String sName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
handles the end element event of the SAX parser

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] buf,
                       int offset,
                       int len)
                throws org.xml.sax.SAXException
handles the characthers event of the SAX parser

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

addParameters

public java.lang.String addParameters(java.lang.String source,
                                      XmlElement existingTag,
                                      java.util.LinkedList insertingTags)
adds parameters from insertingTags list to the profile in the existingTag element

Specified by:
addParameters in interface ProfileInterface

editParameters

public java.lang.String editParameters(java.lang.String source,
                                       XmlElement existingTag,
                                       XmlElement newTag)
edits parameters of existing tag and sets them to match new tag element

Specified by:
editParameters in interface ProfileInterface

getParameter

public java.lang.String getParameter(java.lang.String source,
                                     XmlElement existingTag)
returns requested existing tag

Specified by:
getParameter in interface ProfileInterface

getParameterValue

public java.lang.String getParameterValue(java.lang.String source,
                                          XmlElement existingTag)
returns requested existing tags value