Class TypedLiteral
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.literal.TypedLiteral
-
- All Implemented Interfaces:
Dumpable
,TypeUsageCollectable
public class TypedLiteral extends java.lang.Object implements TypeUsageCollectable, Dumpable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypedLiteral.FormatHint
static class
TypedLiteral.LiteralType
-
Field Summary
Fields Modifier and Type Field Description private InferredJavaType
inferredJavaType
private TypedLiteral.LiteralType
type
private java.lang.Object
value
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypedLiteral(TypedLiteral.LiteralType type, InferredJavaType inferredJavaType, java.lang.Object value)
-
Method Summary
-
-
-
Field Detail
-
inferredJavaType
private final InferredJavaType inferredJavaType
-
type
private final TypedLiteral.LiteralType type
-
value
private final java.lang.Object value
-
-
Constructor Detail
-
TypedLiteral
protected TypedLiteral(TypedLiteral.LiteralType type, InferredJavaType inferredJavaType, java.lang.Object value)
-
-
Method Detail
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
-
integerName
private static java.lang.String integerName(java.lang.Object o, TypedLiteral.FormatHint formatHint)
-
getBoolValue
public boolean getBoolValue()
-
getLongValue
public long getLongValue()
-
getIntValue
public int getIntValue()
-
getFloatValue
public float getFloatValue()
-
getDoubleValue
public double getDoubleValue()
-
getMaybeBoolValue
public java.lang.Boolean getMaybeBoolValue()
-
getMethodHandle
public ConstantPoolEntryMethodHandle getMethodHandle()
-
getClassValue
public JavaTypeInstance getClassValue()
-
charName
private static java.lang.String charName(java.lang.Object o)
-
boolName
private static java.lang.String boolName(java.lang.Object o)
-
hexTest
private static boolean hexTest(java.lang.String hex)
-
longName
private static java.lang.String longName(java.lang.Object o, TypedLiteral.FormatHint formatHint)
-
methodHandleName
private static java.lang.String methodHandleName(java.lang.Object o)
-
methodTypeName
private static java.lang.String methodTypeName(java.lang.Object o)
-
dumpWithHint
public Dumper dumpWithHint(Dumper d, TypedLiteral.FormatHint hint)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getLong
public static TypedLiteral getLong(long v)
-
getInt
public static TypedLiteral getInt(int v, InferredJavaType type)
-
getInt
public static TypedLiteral getInt(int v, RawJavaType type)
-
getInt
public static TypedLiteral getInt(int v)
-
getShort
public static TypedLiteral getShort(int v)
-
getChar
public static TypedLiteral getChar(int v)
-
getBoolean
public static TypedLiteral getBoolean(int v)
-
getDouble
public static TypedLiteral getDouble(double v)
-
getFloat
public static TypedLiteral getFloat(float v)
-
getClass
public static TypedLiteral getClass(JavaTypeInstance v)
-
getString
public static TypedLiteral getString(java.lang.String v)
-
getNull
public static TypedLiteral getNull()
-
getMethodHandle
private static TypedLiteral getMethodHandle(ConstantPoolEntryMethodHandle methodHandle, ConstantPool cp)
-
getMethodType
private static TypedLiteral getMethodType(ConstantPoolEntryMethodType methodType, ConstantPool cp)
-
getConstantPoolEntryUTF8
public static TypedLiteral getConstantPoolEntryUTF8(ConstantPoolEntryUTF8 cpe)
-
getConstantPoolEntry
public static TypedLiteral getConstantPoolEntry(ConstantPool cp, ConstantPoolEntry cpe)
-
shrinkTo
public static TypedLiteral shrinkTo(TypedLiteral original, RawJavaType tgt)
-
getType
public TypedLiteral.LiteralType getType()
-
getValue
public java.lang.Object getValue()
-
getInferredJavaType
public InferredJavaType getInferredJavaType()
-
checkIntegerUsage
public boolean checkIntegerUsage(RawJavaType rawType)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-