tabs.hair
Class HairStyleXMLHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by tabs.hair.HairStyleXMLHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

Instances of this class can be used to parse a XML hair style file. The XML file reading can be optimized for reading only some of the file's content.

See Also:
FOR_THUMBNAIL_READING, FOR_CONTENT_READING, FOR_HIGHLIGHTS_READING, FOR_SHADOW_READING

Field Summary
static int FOR_CONTENT_READING
          The XML file reading is optimized for only Content reading
static int FOR_HIGHLIGHTS_READING
          The XML file reading is optimized for only Highlights reading
static int FOR_SHADOW_READING
          The XML file reading is optimized for only Shadow reading
static int FOR_THUMBNAIL_READING
          The XML file reading is optimized for only Thumbnail reading
 
Constructor Summary
HairStyleXMLHandler()
          Creates a new instance of HairStyleXMLHandler that can be used for reading the complete XML file
HairStyleXMLHandler(int readingMode)
          Creates a new instance of HairStyleXMLHandler that is optimized for reading from the XML file only the given readingMode value.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 java.lang.String getHairOwner_gender()
          The hair owner's gender
 java.lang.String getHairOwner_name()
          The hair owner's name
 java.lang.String getHairStyle_title()
          The hair title
 java.lang.String getHairStyle_type()
          The hair owner's gender
 java.lang.String getStrContent()
          The hair image in Base64
 java.lang.String getStrHighlights()
          The hair highlights in Base64
 java.lang.String getStrShadow()
          The hair shadow in Base64
 java.lang.String getStrThumbnail()
          The hair thumbnail image in Base64
 void initReadingVars()
          Reset this instance's variables so that a new parsing can be made
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endElement, 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
 

Field Detail

FOR_THUMBNAIL_READING

public static final int FOR_THUMBNAIL_READING
The XML file reading is optimized for only Thumbnail reading

See Also:
Constant Field Values

FOR_CONTENT_READING

public static final int FOR_CONTENT_READING
The XML file reading is optimized for only Content reading

See Also:
Constant Field Values

FOR_HIGHLIGHTS_READING

public static final int FOR_HIGHLIGHTS_READING
The XML file reading is optimized for only Highlights reading

See Also:
Constant Field Values

FOR_SHADOW_READING

public static final int FOR_SHADOW_READING
The XML file reading is optimized for only Shadow reading

See Also:
Constant Field Values
Constructor Detail

HairStyleXMLHandler

public HairStyleXMLHandler()
Creates a new instance of HairStyleXMLHandler that can be used for reading the complete XML file


HairStyleXMLHandler

public HairStyleXMLHandler(int readingMode)
Creates a new instance of HairStyleXMLHandler that is optimized for reading from the XML file only the given readingMode value.

The readingMode value is one of the constants defined in class HairStyleXMLHandler which is applicable to instances of this class. The class description lists the constants that are applicable to the class.

Parameters:
readingMode - the type of reading to be done from the XML file
Method Detail

initReadingVars

public void initReadingVars()
Reset this instance's variables so that a new parsing can be made


getStrThumbnail

public java.lang.String getStrThumbnail()
The hair thumbnail image in Base64

Returns:
the hair thumbnail image in Base64

getStrContent

public java.lang.String getStrContent()
The hair image in Base64

Returns:
the hair image in Base64

getStrHighlights

public java.lang.String getStrHighlights()
The hair highlights in Base64

Returns:
the hair highlights in Base64

getStrShadow

public java.lang.String getStrShadow()
The hair shadow in Base64

Returns:
the hair shadow in Base64

getHairOwner_gender

public java.lang.String getHairOwner_gender()
The hair owner's gender

Returns:
the hair owner's gender

getHairOwner_name

public java.lang.String getHairOwner_name()
The hair owner's name

Returns:
the hair owner's name

getHairStyle_title

public java.lang.String getHairStyle_title()
The hair title

Returns:
the hair title

getHairStyle_type

public java.lang.String getHairStyle_type()
The hair owner's gender

Returns:
the hair owner's gender

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  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

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException