Methods Summary |
---|
public void | characters(char[] ch, int start, int length)
String contentStr = ImpsUtils.trim(new String(ch, start, length));
if (contentStr == null || contentStr.length() == 0) {
return;
}
if (mIsTransContent) {
if (!ImpsTags.TransactionContent.equals(mCurTagName)) {
PrimitiveElement curPrimitive = mContentElementsStack.peek();
curPrimitive.setContents(contentStr);
}
} else {
if (ImpsTags.TransactionID.equals(mCurTagName)) {
mPrimitive.setTransactionId(contentStr);
} else if (ImpsTags.TransactionMode.equals(mCurTagName)) {
mPrimitive.setTransactionMode(TransactionMode.valueOf(contentStr));
} else if (ImpsTags.SessionID.equals(mCurTagName)) {
mPrimitive.setSession(contentStr);
} else if (ImpsTags.Poll.equals(mCurTagName)) {
mPrimitive.setPoll(contentStr);
} else if (ImpsTags.CIR.equals(mCurTagName)) {
mPrimitive.setCir(contentStr);
}
}
|
public void | endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
if (ImpsTags.TransactionContent.equals(localName)) {
mIsTransContent = false;
}
if (mIsTransContent) {
if (!mContentElementsStack.empty()) {
mContentElementsStack.pop();
}
}
mCurTagName = null;
|
public Primitive | getPrimitive()
return mPrimitive;
|
public void | reset()
mPrimitive = new Primitive();
mContentElementsStack.clear();
mIsTransContent = false;
|
public void | startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
if (mIsTransContent) {
if (mContentElementsStack.empty()) {
mPrimitive.setContentElement(localName);
mContentElementsStack.push(mPrimitive.getContentElement());
} else {
PrimitiveElement parentPrimitive = mContentElementsStack.peek();
PrimitiveElement childPrimitive = new PrimitiveElement(
localName);
parentPrimitive.addChild(childPrimitive);
mContentElementsStack.push(childPrimitive);
}
} else {
if (ImpsTags.TransactionContent.equals(localName)) {
mIsTransContent = true;
}
}
mCurTagName = localName;
|