Class DFormattingContext
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.DFormattingContext
dexdec
IR formatting context, providing an output sink and specifications for the output.
Plugin codes may want to use a formatting context to generate and customize rendering of the IR.
In most cases, the writing methods like append()
, space()
, etc. will not be
needed by plugins.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a default formatting context.Create a default formatting context. -
Method Summary
Modifier and TypeMethodDescriptionvoid
angle()
Convenience method to append an opening angle bracket (less-than sign) to this sink.void
Convenience method to append a closing angle bracket (greater-than sign) to this sink.append
(char c) Append a character to this sink.append
(int i) Append an integer in base 10 to this sink.Append the string representation of an object to this sink.Append a string to this sink.appendFormat
(String format, Object... args) Append a formatted string to this sink.void
appendFormattedType
(IJavaType type) Append a type to this sink.void
Append a type to this sink if types are to be rendered (seeisDisplayTypes()
).void
brace()
Convenience method to append an opening brace to this sink.void
Convenience method to append a closing brace to this sink.void
bracket()
Convenience method to append an opening bracket to this sink.void
Convenience method to append a closing bracket to this sink.boolean
boolean
boolean
void
paren()
Convenience method to append an opening parenthesis to this sink.void
Convenience method to append a closing parenthesis to this sink.void
setDisplayCanThrow
(boolean displayCanThrow) void
setDisplayTypes
(boolean displayTypes) void
void
setUsePreferredNames
(boolean usePreferredNames) void
space()
Convenience method to append a space to this sink.toString()
-
Constructor Details
-
DFormattingContext
public DFormattingContext()Create a default formatting context. IR types are rendered. -
DFormattingContext
Create a default formatting context. IR types are rendered.- Parameters:
ctx
- optional method context; needed to fetch pool objects (e.g. strings) or fetch effective data
-
-
Method Details
-
setMethodContext
- Parameters:
ctx
- optional method context; needed to fetch pool objects (e.g. strings) or fetch effective data
-
getMethodContext
-
setUsePreferredNames
public void setUsePreferredNames(boolean usePreferredNames) -
isUsePreferredNames
public boolean isUsePreferredNames() -
setDisplayTypes
public void setDisplayTypes(boolean displayTypes) -
isDisplayTypes
public boolean isDisplayTypes() -
setDisplayCanThrow
public void setDisplayCanThrow(boolean displayCanThrow) -
isDisplayCanThrow
public boolean isDisplayCanThrow() -
append
Append the string representation of an object to this sink.- Parameters:
o
- optional (if null, the 'null' string is appended)- Returns:
- this sink
-
append
Append a string to this sink.- Parameters:
str
-- Returns:
- this sink
-
append
Append an integer in base 10 to this sink.- Parameters:
i
-- Returns:
- this sink
-
append
Append a character to this sink.- Parameters:
c
-- Returns:
- this sink
-
appendFormat
Append a formatted string to this sink.- Parameters:
format
- format stringargs
- arguments for the format string- Returns:
- this sink
-
space
public void space()Convenience method to append a space to this sink. -
paren
public void paren()Convenience method to append an opening parenthesis to this sink. -
parenClose
public void parenClose()Convenience method to append a closing parenthesis to this sink. -
brace
public void brace()Convenience method to append an opening brace to this sink. -
braceClose
public void braceClose()Convenience method to append a closing brace to this sink. -
bracket
public void bracket()Convenience method to append an opening bracket to this sink. -
bracketClose
public void bracketClose()Convenience method to append a closing bracket to this sink. -
angle
public void angle()Convenience method to append an opening angle bracket (less-than sign) to this sink. -
angleClose
public void angleClose()Convenience method to append a closing angle bracket (greater-than sign) to this sink. -
appendFormattedTypeIf
Append a type to this sink if types are to be rendered (seeisDisplayTypes()
). Else, do nothing.- Parameters:
type
-
-
appendFormattedType
Append a type to this sink.- Parameters:
type
-
-
toString
-