public abstract class EPSAXDefaultHandler extends org.xml.sax.helpers.DefaultHandler implements LexicalHandler, ITransformerProperties, IPageContextHolder
ContentHandler
and LexicalHandler) and to the page context. If the result is an
instance of SAXResult, then the resultHandler is
available. If the result is an instance of StreamResult, then
the writer is available. The writer is a buffer that holds the result.
doClone() method make sure that the handler remains
thread safe.
DefaultHandler is a simple
copy of the source to the result.
public class MyUIDAdderHandler extends EPSAXDefaultHandler
{
// Map holding the input parameters that this handler exposes.
final private static Map mm_inputParameters = new HashMap(10);
// The list of parameters of this transformer
static
{
// Parameter holding the number of the first ID.
mm_inputParameters.put("StartUID","Integer");
}
private int m_iUIDCounter;
public MyUIDAdderHandler()
{
super();
m_iUIDCounter = 0;
}
// Clones the handler.
public EPSAXDefaultHandler doClone()
{
return new MyUIDAdderHandler();
}
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs)
throws SAXException
{
AttributesImpl newAttrs = new AttributesImpl(attrs);
newAttrs.addAttribute("","","UID","integer",Integer.toString(m_iUIDCounter++));
super.startElement(namespaceURI, localName, qName, newAttrs);
}
public void startDocument() throws SAXException
{
Integer i = (Integer) m_paremetersMap.get("StartUID");
if(i!=null)
{
m_iUIDCounter = i.intValue();
}
super.startDocument();
}
public Map getInputProperties()
{
return mm_inputParameters;
}
}
| Modifier and Type | Field and Description |
|---|---|
protected com.sapportals.htmlb.rendering.IPageContext |
m_pageContext
The current HTMLB page context.
|
protected Map |
m_paremetersMap
The transformer input parameters.
|
ContentHandler |
resultHandler
The result content handler.
|
LexicalHandler |
resultLexicalHanlder
The result lexical handler.
|
Writer |
writer
The writer associated with the result.
|
| Constructor and Description |
|---|
EPSAXDefaultHandler()
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
clearParameters()
Clears the runtime parameters for the handler.
|
void |
comment(char[] ch,
int start,
int length) |
abstract EPSAXDefaultHandler |
doClone()
Clones the handler.
|
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
error(SAXParseException spe) |
void |
fatalError(SAXParseException spe) |
protected String |
getNormalizedString(char[] ch,
int start,
int length)
Gets a string from the specified buffer.
|
com.sapportals.htmlb.rendering.IPageContext |
getPageContext()
Gets the HTMLB page context.
|
Object |
getParemeter(String name)
Gets the parameter value from the runtime parameters.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
processingInstruction(String target,
String data) |
InputSource |
resolveEntity(String arg0,
String arg1) |
void |
setPageContext(com.sapportals.htmlb.rendering.IPageContext context)
Places the HTMLB page context in the holder.
|
void |
setParemeter(String name,
Object value)
Sets a runtime parameter.
|
void |
setResult(Result result)
Sets the result of the transformation.
|
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes attrs) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
notationDecl, setDocumentLocator, unparsedEntityDecl, warningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputPropertiespublic ContentHandler resultHandler
public LexicalHandler resultLexicalHanlder
protected com.sapportals.htmlb.rendering.IPageContext m_pageContext
protected Map m_paremetersMap
public Writer writer
public com.sapportals.htmlb.rendering.IPageContext getPageContext()
IPageContextHoldergetPageContext in interface IPageContextHolderpublic void setPageContext(com.sapportals.htmlb.rendering.IPageContext context)
IPageContextHoldersetPageContext in interface IPageContextHoldercontext - the current page context to holdpublic Object getParemeter(String name)
name - the name of the parameterpublic void setParemeter(String name, Object value)
name - the name of the parameter to setvalue - the value of the parameterpublic void setResult(Result result)
result - the result of the transformationpublic void clearParameters()
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void error(SAXParseException spe) throws SAXException
error in interface ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void fatalError(SAXParseException spe) throws SAXException
fatalError in interface ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerSAXExceptionprotected String getNormalizedString(char[] ch, int start, int length)
ch - the buffer for the charactersstart - the starting point in the bufferlength - the number of characters to take from the bufferpublic abstract EPSAXDefaultHandler doClone()
public InputSource resolveEntity(String arg0, String arg1) throws SAXException
resolveEntity in interface EntityResolverresolveEntity in class org.xml.sax.helpers.DefaultHandlerSAXException| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-ADMIN
|
[sap.com] tc/ep/admin/api/extd
|
api
|
EP-PIN
|
Copyright 2021 SAP SE Complete Copyright Notice