ProgramixGenericLib v5.0.1

com.programix.saxplus
Class SimpleTagHandler

java.lang.Object
  extended by com.programix.saxplus.BaseTagHandler
      extended by com.programix.saxplus.SimpleTagHandler
All Implemented Interfaces:
TagHandler

public class SimpleTagHandler
extends BaseTagHandler
implements TagHandler

Used to gather a single value from a tag--a very common case. Used when a tag has either:

Author:
Paul Hyde

Constructor Summary
SimpleTagHandler()
           
 
Method Summary
 Value getResult()
          This implementation returns ValueFactory.NULL_INSTANCE.
 void startTag(NameDetail tagName, AttributeGroup attr)
           
 void text(Value tagText)
          Delivers textual content within this tag.
 
Methods inherited from class com.programix.saxplus.BaseTagHandler
endSubTag, endTag, getSubTagHandler, getSubTagHandler, setSubTagHandler, setSubTagHandler, startSubTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.programix.saxplus.TagHandler
endSubTag, endTag, startSubTag
 

Constructor Detail

SimpleTagHandler

public SimpleTagHandler()
Method Detail

startTag

public void startTag(NameDetail tagName,
                     AttributeGroup attr)
Specified by:
startTag in interface TagHandler
Overrides:
startTag in class BaseTagHandler

text

public void text(Value tagText)
Description copied from interface: TagHandler
Delivers textual content within this tag. If this tag has no sub tags, then this method is called at most once. If this tag is empty or has no text other than whitespace, this method is not called. If this tag has sub tags and only whitespace between the sub tags, this method is not called. If there is a mixture of (non-whitespace) text and sub tags, this method is called multiple times.

For example:

 <apple>
     <excellent>Red Delicious</excellent>
     <good>Granny Smith</good>
 </apple>
 <fresh value="yes" />
 <mango>
      </mango>
 <story>They are <bold>very</bold> tasty.</story>
 
The text() method is called:

Specified by:
text in interface TagHandler
Overrides:
text in class BaseTagHandler

getResult

public Value getResult()
Description copied from class: BaseTagHandler
This implementation returns ValueFactory.NULL_INSTANCE. Overridden by subclasses as appropriate.

Specified by:
getResult in interface TagHandler
Overrides:
getResult in class BaseTagHandler
Returns:
the value calculated, never null.

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.