本文整理汇总了Java中java.lang.reflect.GenericSignatureFormatError类的典型用法代码示例。如果您正苦于以下问题:Java GenericSignatureFormatError类的具体用法?Java GenericSignatureFormatError怎么用?Java GenericSignatureFormatError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericSignatureFormatError类属于java.lang.reflect包,在下文中一共展示了GenericSignatureFormatError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseFieldTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
private void parseFieldTypeSignature() {
// FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature.
switch (symbol) {
case 'L':
parseClassTypeSignature();
break;
case '[':
// ArrayTypeSignature ::= "[" TypSignature.
actions.parsedSymbol(symbol);
scanSymbol();
updateTypeSignature();
break;
case 'T':
updateTypeVariableSignature();
break;
default:
throw new GenericSignatureFormatError();
}
}
示例2: parseFieldTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
Type parseFieldTypeSignature() {
// FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
// | TypeVariableSignature.
switch (symbol) {
case 'L':
return parseClassTypeSignature();
case '[':
// ArrayTypeSignature ::= "[" TypSignature.
scanSymbol();
return new GenericArrayTypeImpl(parseTypeSignature());
case 'T':
return parseTypeVariableSignature();
default:
throw new GenericSignatureFormatError();
}
}
示例3: parseFieldTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
Type parseFieldTypeSignature() {
// FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
// | TypeVariableSignature.
switch (symbol) {
case 'L':
return parseClassTypeSignature();
case '[':
// ArrayTypeSignature ::= "[" TypSignature.
scanSymbol();
return new ImplForArray(parseTypeSignature());
case 'T':
return parseTypeVariableSignature();
default:
throw new GenericSignatureFormatError();
}
}
示例4: getGenericSuperclass
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
public Type getGenericSuperclass() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
String tmp;
if (isInterface() || ((tmp = getCanonicalName()) != null && tmp.equals("java.lang.Object")) || isPrimitive()) {
return null;
}
if (isArray()) {
return (Type) OBJECT_CLASS;
}
Class<?> clazz = getSuperclass();
if (clazz.getTypeParameters().length == 0) {
return (Type) clazz;
}
return getCache().getGenericSuperclass();
}
示例5: parseFieldTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
Type parseFieldTypeSignature() {
// FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
// | TypeVariableSignature.
switch (symbol) {
case 'L':
return parseClassTypeSignature();
case '[':
// ArrayTypeSignature ::= "[" TypSignature.
scanSymbol();
return new ImplForArray(parseTypeSignature());
case 'T':
return parseTypeVariableSignature();
default:
throw new GenericSignatureFormatError();
}
}
示例6: expect
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
private void expect(char c) {
if (symbol == c) {
scanSymbol();
} else {
throw new GenericSignatureFormatError();
}
}
示例7: parseMessage
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
@Test
public void parseMessage() {
// Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new InvalidParamDataAccessException("message")));
Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new SQLException("message")));
// Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new JedisConnectionException("message")));
// Assert.assertEquals("访问外部接口出错,请稍后重试.", ErrorUtil.parseMessage(new OutSideException("message")));
Assert.assertEquals("更新程序后,还没有重启服务.", ErrorUtil.parseMessage(new GenericSignatureFormatError()));
Assert.assertEquals("message", ErrorUtil.parseMessage(new IllegalArgumentException("message")));
// Assert.assertEquals("message", ErrorUtil.parseMessage(new LeopardRuntimeException("message")));
// Assert.assertEquals("message", ErrorUtil.parseMessage(new LeopardException("message")));
Assert.assertEquals("message", ErrorUtil.parseMessage(new RuntimeException("message")));
Assert.assertEquals("未知错误.", ErrorUtil.parseMessage(new Exception("message")));
}
示例8: readFieldTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
Type readFieldTypeSignature()
{
switch (peekChar())
{
case 'L':
return readClassTypeSignature();
case '[':
return readArrayTypeSignature();
case 'T':
return readTypeVariableSignature();
default:
throw new GenericSignatureFormatError();
}
}
示例9: readArrayTypeSignature
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
Type readArrayTypeSignature()
{
consume('[');
switch (peekChar())
{
case 'L':
case '[':
case 'T':
return new GenericArrayTypeImpl(readFieldTypeSignature());
case 'Z':
consume('Z');
return boolean[].class;
case 'B':
consume('B');
return byte[].class;
case 'S':
consume('S');
return short[].class;
case 'C':
consume('C');
return char[].class;
case 'I':
consume('I');
return int[].class;
case 'F':
consume('F');
return float[].class;
case 'J':
consume('J');
return long[].class;
case 'D':
consume('D');
return double[].class;
default:
throw new GenericSignatureFormatError();
}
}
示例10: scanSymbol
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
void scanSymbol() {
if (!eof) {
if (pos < buffer.length) {
symbol = buffer[pos];
pos++;
} else {
symbol = 0;
eof = true;
}
} else {
throw new GenericSignatureFormatError();
}
}
示例11: expect
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
void expect(char c) {
if (symbol == c) {
scanSymbol();
} else {
throw new GenericSignatureFormatError();
}
}
示例12: scanIdentifier
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
void scanIdentifier() {
if (!eof) {
StringBuilder identBuf = new StringBuilder(32);
if (!isStopSymbol(symbol)) {
identBuf.append(symbol);
do {
char ch = buffer[pos];
if ((ch >= 'a') && (ch <= 'z') || (ch >= 'A') && (ch <= 'Z')
|| !isStopSymbol(ch)) {
identBuf.append(ch);
pos++;
} else {
identifier = identBuf.toString();
scanSymbol();
return;
}
} while (pos != buffer.length);
identifier = identBuf.toString();
symbol = 0;
eof = true;
} else {
// Ident starts with incorrect char.
symbol = 0;
eof = true;
throw new GenericSignatureFormatError();
}
} else {
throw new GenericSignatureFormatError();
}
}
示例13: scanIdentifier
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
void scanIdentifier() {
if (!eof) {
StringBuilder identBuf = new StringBuilder(32);
if (!isStopSymbol(symbol)) {
identBuf.append(symbol);
do {
char ch = buffer[pos];
if ((ch >= 'a') && (ch <= 'z') || (ch >= 'A') && (ch <= 'Z')
|| !isStopSymbol(ch)) {
identBuf.append(buffer[pos]);
pos++;
} else {
identifier = identBuf.toString();
scanSymbol();
return;
}
} while (pos != buffer.length);
identifier = identBuf.toString();
symbol = 0;
eof = true;
} else {
// Ident starts with incorrect char.
symbol = 0;
eof = true;
throw new GenericSignatureFormatError();
}
} else {
throw new GenericSignatureFormatError();
}
}
示例14: test_Constructor
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "",
method = "GenericSignatureFormatError",
args = {}
)
public void test_Constructor() {
assertNotNull(new GenericSignatureFormatError());
}
示例15: getGenericInterfaces
import java.lang.reflect.GenericSignatureFormatError; //导入依赖的package包/类
public Type[] getGenericInterfaces() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
if (isArray()) {
return new Type[]{CLONEABLE_CLASS, SERIALIZABLE_CLASS};
}
if (isPrimitive()) {
return new Type[0];
}
return (Type[])getCache().getGenericInterfaces().clone();
}