Package ghidra.util.xml
Class SpecXmlUtils
java.lang.Object
ghidra.util.xml.SpecXmlUtils
Utilities for encoding and decoding XML datatypes for use in specification files that
are validated by RelaxNG. This currently includes the SLEIGH/Decompiler configuration files.
I.e.
.ldef files
.pspec files
.cspec files
.sla files
Philosophy here is to use and enforce datatype encodings from XML schemas
to try to be as standard as possible and facilitate use of relax grammars etc. But in decoding
possibly be a little more open to deal with resources generated outside of our control.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
decodeBoolean
(String val) static boolean
decodeBoolean
(String val, boolean defaultValue) static int
static long
decodeLong
(String longString) static Boolean
static String
encodeBoolean
(boolean val) static void
encodeBooleanAttribute
(StringBuilder buf, String nm, boolean val) static void
encodeDoubleAttribute
(StringBuilder buf, String nm, double val) static String
encodeSignedInteger
(long val) static void
encodeSignedIntegerAttribute
(StringBuilder buf, String nm, long val) static void
encodeStringAttribute
(StringBuilder buf, String nm, String val) static String
encodeUnsignedInteger
(long val) static void
encodeUnsignedIntegerAttribute
(StringBuilder buf, String nm, long val) static ErrorHandler
static void
xmlEscape
(StringBuilder buf, String val) static void
xmlEscapeAttribute
(StringBuilder buf, String nm, String val) static void
xmlEscapeWriter
(Writer writer, String val)
-
Constructor Details
-
SpecXmlUtils
public SpecXmlUtils()
-
-
Method Details
-
decodeNullableBoolean
-
decodeBoolean
-
decodeBoolean
-
encodeBoolean
-
encodeBooleanAttribute
-
encodeStringAttribute
-
encodeSignedInteger
-
encodeUnsignedInteger
-
encodeSignedIntegerAttribute
-
encodeUnsignedIntegerAttribute
-
encodeDoubleAttribute
-
decodeInt
-
decodeLong
-
xmlEscape
-
xmlEscapeAttribute
-
xmlEscapeWriter
- Throws:
IOException
-
getXmlHandler
-