Creates a new ParserBase object
The data format of the file data to be parsed. Can be either ParserDataFormat.BINARY
or ParserDataFormat.PLAIN_TEXT
, and should be provided by the concrete subtype.
Returned by proceedParsing
to indicate more parsing is needed, allowing asynchronous parsing.
Returned by proceedParsing
to indicate no more parsing is needed.
The data format of the file data to be parsed. Options are URLLoaderDataFormat.BINARY
, URLLoaderDataFormat.ARRAY_BUFFER
, URLLoaderDataFormat.BLOB
, URLLoaderDataFormat.VARIABLES
or URLLoaderDataFormat.TEXT
.
A list of dependencies that need to be loaded and resolved for the object being parsed.
Resolve a dependency when it's loaded. For example, a dependency containing an ImageResource would be assigned to a Mesh instance as a BitmapMaterial, a scene graph object would be added to its intended parent. The dependency should be a member of the dependencies property.
The dependency to be resolved.
Resolve a dependency loading failure. Used by parser to eventually provide a default map
The dependency to be resolved.
Resolve a dependency name
The dependency to be resolved.
Finish parsing the data.
Tests whether or not there is still time left for parsing within the maximum allowed time frame per session.
True if there is still time left, false if the maximum allotted time was exceeded and parsing should be interrupted.
Called when the parsing pause interval has passed and parsing can proceed.
Parse the next block of data.
Whether or not more data needs to be parsed. Can be ParserBase.ParserBase.PARSING_DONE
or
ParserBase.ParserBase.MORE_TO_PARSE
.
Initializes the parsing of data.
The maximum duration of a parsing session.
Add an event listener
Dispatch an event
check if an object has an event listener assigned to it
Parse data (possibly containing bytearry, plain text or BitmapAsset) asynchronously, meaning that the parser will periodically stop parsing so that the AVM may proceed to the next frame.
The untyped data object in which the loaded data resides.
number of milliseconds of parsing allowed per frame. The actual time spent on a frame can exceed this number since time-checks can only be performed between logical sections of the parsing procedure.
Remove an event listener
Generated using TypeDoc
ParserBase
provides an abstract base export class for objects that convert blocks of data to data structures supported by away.If used by
Loader
to automatically determine the parser type, two public static methods should be implemented, with the following signatures:public static supportsType(extension : string) : boolean
Indicates whether or not a given file extension is supported by the parser.public static supportsData(data : *) : boolean
Tests whether a data block can be parsed by the parser.Furthermore, for any concrete subtype, the method
initHandle
should be overridden to immediately create the object that will contain the parsed data. This allowsResourceManager
to return an object handle regardless of whether the object was loaded or not.Loader