Package kala.compress.harmony.unpack200
Class NewAttributeBands
java.lang.Object
kala.compress.harmony.unpack200.BandSet
kala.compress.harmony.unpack200.NewAttributeBands
Sets of bands relating to a non-predefined attribute
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceAn AttributeLayoutElement is a part of an attribute layout and has one or more bands associated with it, which transmit the AttributeElement data for successive Attributes of this type.classstatic classclassprivate static classclassConstant Pool ReferenceclassA replication is an array of layout elements, with an associated countclassA Union is a type of layout element where the tag value acts as a selector for one of the union casesclassA Union case -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttributeLayoutprotected List<NewAttributeBands.AttributeLayoutElement> private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns theBHSDCodecthat should be used for the given layout element.private AttributegetOneAttribute(int index, List<NewAttributeBands.AttributeLayoutElement> elements) Gets one attribute at the given index from the various bands.private StringReaderUtility method to get the contents of the given stream, up to the next], (ignoring pairs of brackets[and])parseAttributes(InputStream in, int occurrenceCount) Parse the bands relating to this AttributeLayout and return the correct class file attributes as a List ofAttribute.private voidTokenize the layout into AttributeElementsvoidread(InputStream in) private List<NewAttributeBands.LayoutElement> readBody(StringReader stream) Read a 'body' section of the layout from the given streamreadNextAttributeElement(StringReader stream) private NewAttributeBands.LayoutElementreadNextLayoutElement(StringReader stream) private NewAttributeBands.UnionCasereadNextUnionCase(StringReader stream) Read a UnionCase from the stream.private IntegerreadNumber(StringReader stream) Read a number from the stream and return itprivate StringreadUpToMatchingBracket(StringReader stream) Gets the contents of the given stream, up to the next], (ignoring pairs of brackets[and])private voidResolve calls in the attribute layout and returns the number of backwards callsprivate intresolveCallsForElement(int i, NewAttributeBands.Callable currentCallable, NewAttributeBands.LayoutElement layoutElement) voidsetBackwardsCalls(int[] backwardsCalls) Once the attribute bands have been read the callables can be informed about the number of times each is subject to a backwards call.voidunpack()Methods inherited from class kala.compress.harmony.unpack200.BandSet
decodeBandInt, decodeBandInt, getReferences, getReferences, parseCPClassReferences, parseCPDescriptorReferences, parseCPDoubleReferences, parseCPFieldRefReferences, parseCPFloatReferences, parseCPInterfaceMethodRefReferences, parseCPIntReferences, parseCPLongReferences, parseCPMethodRefReferences, parseCPSignatureReferences, parseCPSignatureReferences, parseCPStringReferences, parseCPUTF8References, parseCPUTF8References, parseFlags, parseFlags, parseFlags, parseFlags, parseReferences, parseReferences, unpack
-
Field Details
-
attributeLayout
-
backwardsCallCount
private int backwardsCallCount -
attributeLayoutElements
-
-
Constructor Details
-
NewAttributeBands
- Throws:
IOException
-
-
Method Details
-
getBackwardsCallCount
public int getBackwardsCallCount() -
getCodec
Returns theBHSDCodecthat should be used for the given layout element.- Parameters:
layoutElement- TODO- Returns:
- the
BHSDCodecthat should be used for the given layout element.
-
getOneAttribute
private Attribute getOneAttribute(int index, List<NewAttributeBands.AttributeLayoutElement> elements) Gets one attribute at the given index from the various bands. The correct bands must have already been read in.- Parameters:
index- TODOelements- TODO- Returns:
- attribute at the given index.
-
getStreamUpToMatchingBracket
Utility method to get the contents of the given stream, up to the next], (ignoring pairs of brackets[and])- Parameters:
stream-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
parseAttributes
public List<Attribute> parseAttributes(InputStream in, int occurrenceCount) throws IOException, Pack200Exception Parse the bands relating to this AttributeLayout and return the correct class file attributes as a List ofAttribute.- Parameters:
in- parse source.occurrenceCount- TODO- Returns:
- Class file attributes as a List of
Attribute. - Throws:
IOException- If an I/O error occurs.Pack200Exception- TODO
-
parseLayout
Tokenize the layout into AttributeElements- Throws:
IOException- If an I/O error occurs.
-
read
- Specified by:
readin classBandSet- Throws:
IOExceptionPack200Exception
-
readBody
Read a 'body' section of the layout from the given stream- Parameters:
stream-- Returns:
- List of LayoutElements
- Throws:
IOException- If an I/O error occurs.
-
readNextAttributeElement
private NewAttributeBands.AttributeLayoutElement readNextAttributeElement(StringReader stream) throws IOException - Throws:
IOException
-
readNextLayoutElement
private NewAttributeBands.LayoutElement readNextLayoutElement(StringReader stream) throws IOException - Throws:
IOException
-
readNextUnionCase
Read a UnionCase from the stream.- Parameters:
stream- source stream.- Returns:
- A UnionCase from the stream.
- Throws:
IOException- If an I/O error occurs.
-
readNumber
Read a number from the stream and return it- Parameters:
stream-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
readUpToMatchingBracket
Gets the contents of the given stream, up to the next], (ignoring pairs of brackets[and])- Parameters:
stream- input stream.- Returns:
- the contents of the given stream.
- Throws:
IOException- If an I/O error occurs.
-
resolveCalls
private void resolveCalls()Resolve calls in the attribute layout and returns the number of backwards calls -
resolveCallsForElement
private int resolveCallsForElement(int i, NewAttributeBands.Callable currentCallable, NewAttributeBands.LayoutElement layoutElement) -
setBackwardsCalls
Once the attribute bands have been read the callables can be informed about the number of times each is subject to a backwards call. This method is used to set this information.- Parameters:
backwardsCalls- one int for each backwards callable, which contains the number of times that callable is subject to a backwards call.- Throws:
IOException- If an I/O error occurs.
-
unpack
- Specified by:
unpackin classBandSet- Throws:
IOExceptionPack200Exception
-