public class StixJsonParser extends Object
Modifier and Type | Class and Description |
---|---|
class |
StixJsonParser.StixJsonArray
StixJsonArray holds a representation of a JSON array
in a raw format.
|
class |
StixJsonParser.StixJsonObject
StixJsonObject holds a representation of a StixObject (or pseudo-object)
in a raw format.
|
Modifier and Type | Field and Description |
---|---|
static int |
CHAR_REPLACE_ALL_ILLEGAL_CHARS
The enumerated value indicating to replace any illegal foldered object characters with dashes in a String.
|
static int |
CHAR_REPLACE_NEWLINES
The enumerated value indicating to replace any newline characters with spaces in a String.
|
static int |
CHAR_REPLACE_NONE
The enumerated value indicating not to replace any characters in a String.
|
static String |
INDENT
Amount to indent when building indented trees.
|
Constructor and Description |
---|
StixJsonParser(InputStream stream)
Constructs a StixJsonParser from an InputStream.
|
StixJsonParser(Reader reader)
Constructs a StixJsonParser from a Reader.
|
StixJsonParser(String text)
Constructs a StixJsonParser from literal JSON text.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(LibrarySession session)
Execute the prepared JSON, creating all of the defined STIX objects.
|
List<LibraryObject> |
getCreatedObjects()
Gets the list of objects that were created during execution.
|
List<String> |
getEventStrings()
Gets the parsed event strings.
|
List<String> |
getParsedJsonTree(String indent)
Gets the String list representation of the parsed object.
|
void |
parse()
Perform the parse for this instance.
|
void |
prepare(LibrarySession session,
StixReport report)
Prepare the parsed JSON for execution.
|
public static final int CHAR_REPLACE_NONE
public static final int CHAR_REPLACE_NEWLINES
public static final int CHAR_REPLACE_ALL_ILLEGAL_CHARS
public static final String INDENT
public StixJsonParser(String text)
text
- the JSON text.public StixJsonParser(Reader reader)
reader
- the reader containing the JSONpublic StixJsonParser(InputStream stream)
stream
- the stream containing the JSONpublic List<String> getEventStrings()
public List<String> getParsedJsonTree(String indent)
public List<LibraryObject> getCreatedObjects()
public void parse()
text
- the JSON text.public void prepare(LibrarySession session, StixReport report) throws IfsException
session
- the session contextreport
- the encapsulating STIX reportIfsException
- if the operation failspublic void execute(LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failsCopyright © 2023. All rights reserved.