Package ghidra.util.xml
Class SpecXmlUtils
- java.lang.Object
-
- ghidra.util.xml.SpecXmlUtils
-
public class SpecXmlUtils extends java.lang.Object
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
Constructors Constructor Description SpecXmlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
decodeBoolean(java.lang.String val)
static int
decodeInt(java.lang.String intString)
static long
decodeLong(java.lang.String longString)
static java.lang.String
encodeBoolean(boolean val)
static void
encodeBooleanAttribute(java.lang.StringBuilder buf, java.lang.String nm, boolean val)
static void
encodeDoubleAttribute(java.lang.StringBuilder buf, java.lang.String nm, double val)
static java.lang.String
encodeSignedInteger(long val)
static void
encodeSignedIntegerAttribute(java.lang.StringBuilder buf, java.lang.String nm, long val)
static void
encodeStringAttribute(java.lang.StringBuilder buf, java.lang.String nm, java.lang.String val)
static java.lang.String
encodeUnsignedInteger(long val)
static void
encodeUnsignedIntegerAttribute(java.lang.StringBuilder buf, java.lang.String nm, long val)
static org.xml.sax.ErrorHandler
getXmlHandler()
static void
xmlEscape(java.lang.StringBuilder buf, java.lang.String val)
static void
xmlEscapeAttribute(java.lang.StringBuilder buf, java.lang.String nm, java.lang.String val)
static void
xmlEscapeWriter(java.io.Writer writer, java.lang.String val)
-
-
-
Method Detail
-
decodeBoolean
public static boolean decodeBoolean(java.lang.String val)
-
encodeBoolean
public static java.lang.String encodeBoolean(boolean val)
-
encodeBooleanAttribute
public static void encodeBooleanAttribute(java.lang.StringBuilder buf, java.lang.String nm, boolean val)
-
encodeStringAttribute
public static void encodeStringAttribute(java.lang.StringBuilder buf, java.lang.String nm, java.lang.String val)
-
encodeSignedInteger
public static java.lang.String encodeSignedInteger(long val)
-
encodeUnsignedInteger
public static java.lang.String encodeUnsignedInteger(long val)
-
encodeSignedIntegerAttribute
public static void encodeSignedIntegerAttribute(java.lang.StringBuilder buf, java.lang.String nm, long val)
-
encodeUnsignedIntegerAttribute
public static void encodeUnsignedIntegerAttribute(java.lang.StringBuilder buf, java.lang.String nm, long val)
-
encodeDoubleAttribute
public static void encodeDoubleAttribute(java.lang.StringBuilder buf, java.lang.String nm, double val)
-
decodeInt
public static int decodeInt(java.lang.String intString)
-
decodeLong
public static long decodeLong(java.lang.String longString)
-
xmlEscape
public static void xmlEscape(java.lang.StringBuilder buf, java.lang.String val)
-
xmlEscapeAttribute
public static void xmlEscapeAttribute(java.lang.StringBuilder buf, java.lang.String nm, java.lang.String val)
-
xmlEscapeWriter
public static void xmlEscapeWriter(java.io.Writer writer, java.lang.String val) throws java.io.IOException
- Throws:
java.io.IOException
-
getXmlHandler
public static org.xml.sax.ErrorHandler getXmlHandler()
-
-