package net.jaekl.cfb.xml;
+import java.io.PrintWriter;
import java.util.ArrayList;
import org.xml.sax.Attributes;
+import net.jaekl.qd.xml.MissingAttributeException;
import net.jaekl.qd.xml.ParseResult;
import net.jaekl.qd.xml.XmlParseException;
m_isStatic = false;
m_sourceLines = new ArrayList<SourceLine>();
}
-
+
@Override
- public void endContents(String uri, String localName, String qName, String chars, Attributes attr)
- throws XmlParseException
+ public void handleMainAttributes(Attributes attr) throws MissingAttributeException
{
m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
m_methodName = getRequiredAttr(TAG, attr, METHOD_NAME);
m_signature = getRequiredAttr(TAG, attr, SIGNATURE);
m_isStatic = getRequiredAttr(TAG, attr, IS_STATIC).equals(TRUE);
- m_role = getOptionalAttr(attr, ROLE, null);
+ m_role = getOptionalAttr(attr, ROLE, null);
+ }
+
+ @Override
+ public void endContents(String uri, String localName, String qName, String chars)
+ throws XmlParseException
+ {
+ // no-op
}
@Override
}
}
}
+
+ @Override
+ public void dump(PrintWriter pw, int indent)
+ {
+ super.dump(pw, indent);
+ String tab = String.format("%" + (indent + 2) + "s", "");
+
+ pw.println(tab
+ + (m_isStatic ? "static" : "")
+ + m_className
+ + "."
+ + m_methodName
+ + m_signature);
+ if (null != m_role) {
+ pw.println(tab + ROLE + "=" + m_role);
+ }
+ if (null != m_sourceLines) {
+ for (SourceLine sl : m_sourceLines) {
+ sl.dump(pw, indent + 2);
+ }
+ }
+ }
}