Class SleighLanguageValidator
- java.lang.Object
-
- ghidra.app.plugin.processors.sleigh.SleighLanguageValidator
-
public class SleighLanguageValidator extends java.lang.Object
Validate SLEIGH related XML configuration files: .cspec .pspec and .ldefs A ResourceFile containing an XML document can be verified with one of the static methods: - validateCspecFile - validateLdefsFile - validatePspecFile Alternately the class can be instantiated, which will allocate a single verifier that can be run on multiple files.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CSPEC_TYPE
static int
CSPECTAG_TYPE
static int
LDEFS_TYPE
static int
PSPEC_TYPE
-
Constructor Summary
Constructors Constructor Description SleighLanguageValidator(int type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
validateCspecFile(ResourceFile cspecFile)
static void
validateLdefsFile(ResourceFile ldefsFile)
static void
validatePspecFile(ResourceFile pspecFile)
void
verify(ResourceFile specFile)
Verify the given file against this validator.void
verify(java.lang.String title, java.lang.String document)
Verify an XML document as a string against this validator.
-
-
-
Field Detail
-
CSPEC_TYPE
public static final int CSPEC_TYPE
- See Also:
- Constant Field Values
-
PSPEC_TYPE
public static final int PSPEC_TYPE
- See Also:
- Constant Field Values
-
LDEFS_TYPE
public static final int LDEFS_TYPE
- See Also:
- Constant Field Values
-
CSPECTAG_TYPE
public static final int CSPECTAG_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
verify
public void verify(ResourceFile specFile) throws SleighException
Verify the given file against this validator.- Parameters:
specFile
- is the file- Throws:
SleighException
- with an explanation if the file does not validate
-
verify
public void verify(java.lang.String title, java.lang.String document) throws SleighException
Verify an XML document as a string against this validator. Currently this only supports verifierType == CSPECTAG_TYPE.- Parameters:
title
- is a description of the documentdocument
- is the XML document body- Throws:
SleighException
- with an explanation if the document does not validate
-
validateLdefsFile
public static void validateLdefsFile(ResourceFile ldefsFile) throws SleighException
- Throws:
SleighException
-
validatePspecFile
public static void validatePspecFile(ResourceFile pspecFile) throws SleighException
- Throws:
SleighException
-
validateCspecFile
public static void validateCspecFile(ResourceFile cspecFile) throws SleighException
- Throws:
SleighException
-
-