Class SpecXmlUtils

java.lang.Object
ghidra.util.xml.SpecXmlUtils

public class SpecXmlUtils extends 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 Details

    • SpecXmlUtils

      public SpecXmlUtils()
  • Method Details

    • decodeNullableBoolean

      public static Boolean decodeNullableBoolean(String val)
    • decodeBoolean

      public static boolean decodeBoolean(String val)
    • decodeBoolean

      public static boolean decodeBoolean(String val, boolean defaultValue)
    • encodeBoolean

      public static String encodeBoolean(boolean val)
    • encodeBooleanAttribute

      public static void encodeBooleanAttribute(StringBuilder buf, String nm, boolean val)
    • encodeStringAttribute

      public static void encodeStringAttribute(StringBuilder buf, String nm, String val)
    • encodeSignedInteger

      public static String encodeSignedInteger(long val)
    • encodeUnsignedInteger

      public static String encodeUnsignedInteger(long val)
    • encodeSignedIntegerAttribute

      public static void encodeSignedIntegerAttribute(StringBuilder buf, String nm, long val)
    • encodeUnsignedIntegerAttribute

      public static void encodeUnsignedIntegerAttribute(StringBuilder buf, String nm, long val)
    • encodeDoubleAttribute

      public static void encodeDoubleAttribute(StringBuilder buf, String nm, double val)
    • decodeInt

      public static int decodeInt(String intString)
    • decodeLong

      public static long decodeLong(String longString)
    • xmlEscape

      public static void xmlEscape(StringBuilder buf, String val)
    • xmlEscapeAttribute

      public static void xmlEscapeAttribute(StringBuilder buf, String nm, String val)
    • xmlEscapeWriter

      public static void xmlEscapeWriter(Writer writer, String val) throws IOException
      Throws:
      IOException
    • getXmlHandler

      public static ErrorHandler getXmlHandler()