diff options
Diffstat (limited to 'src/main/javassist/bytecode/SignatureAttribute.java')
-rw-r--r-- | src/main/javassist/bytecode/SignatureAttribute.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/SignatureAttribute.java b/src/main/javassist/bytecode/SignatureAttribute.java index 39f4e35b..808809ed 100644 --- a/src/main/javassist/bytecode/SignatureAttribute.java +++ b/src/main/javassist/bytecode/SignatureAttribute.java @@ -489,6 +489,9 @@ public class SignatureAttribute extends AttributeInfo { } } + /** + * Type variables. + */ public static class TypeVariable extends ObjectType { String name; @@ -516,6 +519,7 @@ public class SignatureAttribute extends AttributeInfo { * * @param sig the signature. * @throws BadBytecode thrown when a syntactical error is found. + * @since 3.5 */ public static ClassSignature toClassSignature(String sig) throws BadBytecode { try { @@ -531,6 +535,7 @@ public class SignatureAttribute extends AttributeInfo { * * @param sig the signature. * @throws BadBytecode thrown when a syntactical error is found. + * @since 3.5 */ public static MethodSignature toMethodSignature(String sig) throws BadBytecode { try { @@ -541,6 +546,23 @@ public class SignatureAttribute extends AttributeInfo { } } + /** + * Parses the given signature string as a field type signature. + * + * @param sig the signature string. + * @return the field type signature. + * @throws BadBytecode thrown when a syntactical error is found. + * @since 3.5 + */ + public static ObjectType toFieldSignature(String sig) throws BadBytecode { + try { + return parseObjectType(sig, new Cursor(), false); + } + catch (IndexOutOfBoundsException e) { + throw error(sig); + } + } + private static ClassSignature parseSig(String sig) throws BadBytecode, IndexOutOfBoundsException { |