public class

AsciiDocument

extends AbstractTextDocument
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.events.EventSource
     ↳ com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
       ↳ com.pnfsoftware.jeb.core.output.text.impl.AsciiDocument

Class Overview

A text document used to represent textual data, on a best-effort basis. Units may generate this type of document when they would like to have clients represent some or all their contents as text data.

The input data can be of any size, up to 2^63 bytes, and arbitrarily encoded. Non Ascii-printable characters will be escaped and rendered as \x?? entities.

Similarly to HexDumpDocument objects, these objects are not necessarily tied to units. If related to units, and since the addressing scheme may not consistent with other documents' of such unit, the reserved prefix '@' is used for addresses. Addresses are like: @line,column where line and column are 1-based.

Note: this document is not serializable; it should not be used in a list of persisted presentations.

Summary

[Expand]
Inherited Fields
From class com.pnfsoftware.jeb.util.events.EventSource
Public Constructors
AsciiDocument(IInput input)
Create a text document.
Public Methods
ICoordinates addressToCoordinates(String address, CoordinatesConversionPrecision precision)
Precision is not used - Use an exact address
String coordinatesToAddress(ICoordinates coordinates, AddressConversionPrecision precision)
Convert document-specific text coordinates to a unit-specific address.
long getAnchorCount()
ITextDocumentPart getDocumentPart(long anchorId, int linesAfter, int linesBefore)
Protected Methods
boolean useDisplayLineNumber()
Specify if coordinatesToAddress(ICoordinates, AddressConversionPrecision) and addressToCoordinates(String, CoordinatesConversionPrecision) will use the anchor inner value or should display as a text editor (where first line is line 1).
boolean useLineDelta()
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
From class com.pnfsoftware.jeb.util.events.EventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.output.IGenericDocument
From interface com.pnfsoftware.jeb.core.output.text.ITextDocument
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public AsciiDocument (IInput input)

Create a text document.

Parameters
input the input data

Public Methods

public ICoordinates addressToCoordinates (String address, CoordinatesConversionPrecision precision)

Precision is not used - Use an exact address

Parameters
address a textual address
Returns
  • the text coordinates, null on error

public String coordinatesToAddress (ICoordinates coordinates, AddressConversionPrecision precision)

Convert document-specific text coordinates to a unit-specific address.

Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

Parameters
coordinates the coordinates
precision indicate the precision of the address ( COARSE will return a raw address, with a faster result while FINE will return a more precise address that can be a bit longer). If COARSE can not be retrieved, it may return a null result, and the user will need to recall this method with another precision.
Returns
  • the address, null on error

public long getAnchorCount ()

public ITextDocumentPart getDocumentPart (long anchorId, int linesAfter, int linesBefore)

Protected Methods

protected boolean useDisplayLineNumber ()

Specify if coordinatesToAddress(ICoordinates, AddressConversionPrecision) and addressToCoordinates(String, CoordinatesConversionPrecision) will use the anchor inner value or should display as a text editor (where first line is line 1). Line Delta and column offset are not modified.

protected boolean useLineDelta ()

Specify if coordinatesToAddress(ICoordinates, AddressConversionPrecision) and addressToCoordinates(String, CoordinatesConversionPrecision) will use the line Delta. Default is true, but implementations can decide to use only one line for an anchor.