# Class: com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink

This output sink is the recipient for the generation of a decompiled Java Abstract Syntax Tree \(AST\). The sink also contains configuration elements that will guide how certain AST elements are generated. Typically, a sink receives the output for a class or a method element. 

 Generating an AST yields a special type of elements, called items, that a client \(such as the decompiler UI\) may want to track to achieve higher level purpose such as xrefs building, renaming, easy syntax coloring, etc. Items include keywords, class/field/method/variable names, labels, etc. The type of items generated depends on the item factory provided to JavaOutputSink constructors.

## Constructor: JavaOutputSink
- parameter: `baseAnchorId`, type: `int`


## Constructor: JavaOutputSink
- parameter: `baseAnchorId`, type: `int`
- parameter: `doc`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaDocument`
- parameter: `dexdec`, type: `com.pnfsoftware.jeb.core.units.code.android.IDexDecompilerUnit`


## Method: addGeneratedAnon
- parameter: `container`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaClass`

Description: Register an anonymous type \(most likely a class\) that's about to be rendered as inline code, inside a method or another class. We use this multi\-map to track anonymous types that were actually rendered, and those that were not. That can happen in obfuscated files where anonymous inner classes are used by third\-party \(not the container\) classes only.
parameter: container: method or class
parameter: c: an anonymous that's about to be generated \(recorded to avoid generated it later\)

## Method: appendAnnotationsList
- parameter: `annotations`, type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaAnnotation>`
- parameter: `charAfterAnno`, type: `char`


## Method: appendAnnotationsList
- parameter: `annotations`, type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaAnnotation>`
- parameter: `charAfterAnno`, type: `char`
- parameter: `skiplist`, type: `java.util.Set<java.lang.String>`


## Method: appendKeyword
- parameter: `keyword`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaKeyword`


## Method: appendKeyword
- parameter: `keyword`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaKeyword`
- parameter: `itemId`, type: `long`


## Method: astDepth
- return type: `int`


## Method: astParent
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`

Description: Make sure to call before `generateEnter`.
return: the parent of the element AST about to be rendered or null if there is none or none         can be found

## Method: astPop
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`


## Method: astPush
- parameter: `elt`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`


## Method: doneGeneratingReplacement


## Method: getContainingMethods
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.code.java.IJavaMethod>`


## Method: getCurrentAnonymousBaseType
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`


## Method: getCurrentAnonymousCaptureInfo
- return type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink.CaptureInfo`


## Method: getCurrentContainingClass
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaClass`


## Method: getCurrentContainingMethod
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaMethod`


## Method: getCurrentMethodIndex
- return type: `int`

Description: Get the method index of the method being generated
return: <0 if cannot be determined or invalid

## Method: getDecompilables
- return type: `java.util.List<java.lang.String>`

Description: Retrieve the list of addresses of the decompilable \(classes, fields, methods\) items generated in this part.
return: a list of items, ordered as they appear in the decompiled output

## Method: getDecompilerUnit
- return type: `com.pnfsoftware.jeb.core.units.code.android.IDexDecompilerUnit`

Description: May be null

## Method: getDisplayMethodInternalsAsComment
- return type: `int`


## Method: getDisplayPrivateMethodsLast
- return type: `boolean`


## Method: getDisregardCollapse
- return type: `boolean`


## Method: getDoNotGenerateThisIfPossible
- return type: `boolean`


## Method: getDocument
- return type: `com.pnfsoftware.jeb.core.units.code.java.JavaDocument`

Description: May be null

## Method: getDynamicContentManager
- return type: `com.pnfsoftware.jeb.core.units.code.java.IDynamicContentManager`


## Method: getGenerateAnnotations
- return type: `boolean`


## Method: getGenerateLambdas
- return type: `boolean`


## Method: getGenerateOverrideAnnotations
- return type: `boolean`


## Method: getGenerateSyntheticFields
- return type: `boolean`


## Method: getGenerateSyntheticMethods
- return type: `boolean`


## Method: getGeneratedAnon
- parameter: `container`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.java.IJavaClass>`


## Method: getIdentifierCoordinates
- return type: `java.util.Map<java.lang.Long,java.util.List<com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates>>`


## Method: getInsertBlankLinesAfterCompounds
- return type: `boolean`


## Method: getReplacementFor
- parameter: `ident`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier`
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaExpression`


## Method: getResolveFieldAccessTargets
- return type: `boolean`


## Method: getResolveMethodCallTargets
- return type: `boolean`


## Method: getSortItemsForRendering
- return type: `int`


## Method: getSplitCallArgThreshold
- return type: `int`


## Method: getTopLevelClass
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaClass`


## Method: getUseDebugInfoNames
- return type: `boolean`


## Method: getUseVarReservedType
- return type: `boolean`


## Method: isBeingGenerated
- parameter: `elt`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaElement`
- return type: `boolean`


## Method: loadCommentInline
- parameter: `insnCoord`, type: `com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates`


## Method: popAnonymousBaseType
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`


## Method: popAnonymousCaptureInfo
- return type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink.CaptureInfo`


## Method: popContainingClass
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaClass`


## Method: popContainingMethod
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaMethod`


## Method: popReplacements
- return type: `java.util.Map<com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier,com.pnfsoftware.jeb.core.units.code.java.IJavaExpression>`


## Method: pushAnonymousBaseType
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`


## Method: pushAnonymousCaptureInfo
- parameter: `info`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOutputSink.CaptureInfo`


## Method: pushContainingClass
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaClass`


## Method: pushContainingMethod
- parameter: `m`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaMethod`


## Method: pushReplacements
- parameter: `replmap`, type: `java.util.Map<com.pnfsoftware.jeb.core.units.code.java.IJavaIdentifier,com.pnfsoftware.jeb.core.units.code.java.IJavaExpression>`


## Method: recordGeneratedDecompilable
- parameter: `signature`, type: `java.lang.String`


## Method: recordIdentifierCoordinates
- parameter: `objectId`, type: `long`
- parameter: `coordinates`, type: `com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates`


## Method: renderInlineComment
- parameter: `coord`, type: `com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates`
- parameter: `appendEOL`, type: `boolean`


## Method: renderPreComment
- parameter: `coord`, type: `com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates`

Description: note: EOL always appended

## Method: requestGeneratingReplacement
- return type: `boolean`


## Method: setCurrentMethodIndex
- parameter: `index`, type: `int`
- return type: `int`

Description: Set the method index of the method being generated
parameter: index: the current method index
return: the previous index

## Method: setDynamicContentManager
- parameter: `dcm`, type: `com.pnfsoftware.jeb.core.units.code.java.IDynamicContentManager`


## Method: setGeneratingReplacement
- parameter: `generatingReplacement`, type: `boolean`


## Method: validate


