|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
ilog.cpl.storage.IlpAbstractSAXHandler
ilog.cpl.storage.IlpAbstractChainedSAXHandler
ilog.cpl.storage.IlpSAXAttributeValueHandler
public class IlpSAXAttributeValueHandler
Default SAX handler for attribute values.
This class is used to retrieve the values of attributes in an XML file or stream.
The values may be default values of attributes, or the values of attributes of an instance.
By default, the value of an attribute is directly the text of the attribute element converted to the "right" class.
This class may either be specified in the XML file or come from the
IlpAttribute.
To change this behavior, you can derive this class and provide your custom
implementation for your attribute classes or IlpAttribute using the
IlpSAXSerializable interface.
IlpSAXSerializable| Nested Class Summary | |
|---|---|
static interface |
IlpSAXAttributeValueHandler.ResultHandler
Internal use. |
| Constructor Summary | |
|---|---|
IlpSAXAttributeValueHandler()
|
|
| Method Summary | |
|---|---|
void |
endElement(String namespaceURI,
String localName,
String qName)
Notifies that the end of an element is reached. |
protected Object |
getAttributeValue()
This method is called at the end of the finalTag element. |
protected String |
getFinalTag()
Returns the tag used to finalize the element. |
protected IlpSAXAttributeValueHandler.ResultHandler |
getResultHandler()
Returns the result handler. |
Class |
getTargetClass()
Returns the target class. |
IlpTypeConverter |
getTypeConverter()
Returns the type converter. |
protected boolean |
isNull()
Returns true if the result is null. |
void |
readValue(IlpAbstractSAXHandler parent,
String finalTag,
IlpSAXAttributeValueHandler.ResultHandler resultHandler,
Class targetClass,
IlpTypeConverter typeConverter)
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
Notifies the beginning of an element. |
| Methods inherited from class ilog.cpl.storage.IlpAbstractChainedSAXHandler |
|---|
getLocator, getLogger, getParent, getXMLReader, setParent |
| Methods inherited from class ilog.cpl.storage.IlpAbstractSAXHandler |
|---|
characters, checkState, clearContent, clearState, error, fatalError, getContent, getState, ignoreUntil, log, logIgnoreElement, processSAXParseException, removeState, setState, throwSAXParseException, warning |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlpSAXAttributeValueHandler()
| Method Detail |
|---|
public Class getTargetClass()
javaClass)
XML attribute, or comes from IlpAttribute
(see IlpAttribute.getValueClass().
public IlpTypeConverter getTypeConverter()
protected boolean isNull()
true if the result is null.
protected String getFinalTag()
protected IlpSAXAttributeValueHandler.ResultHandler getResultHandler()
public void readValue(IlpAbstractSAXHandler parent,
String finalTag,
IlpSAXAttributeValueHandler.ResultHandler resultHandler,
Class targetClass,
IlpTypeConverter typeConverter)
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
null XML attribute and
clears the content of the element.
If you redefine this method, take care of always calling this implementation.
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXException
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
resultHandler.setAttributeValue
method is called and the parsing continues with the parent contentHandler.
If you redefine this method, make sure you always call this implementation.
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionprotected Object getAttributeValue()
finalTag element.
By default, it converts the content to the target class
using the type converter. It is not even called if isNull()
returns true; that is, if the null XML
attribute was set to true.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||