org.objectweb.asm.Type.getConstructorDescriptor()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.objectweb.asm.Type.getConstructorDescriptor()方法的一些代码示例,展示了Type.getConstructorDescriptor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Type.getConstructorDescriptor()方法的具体详情如下:
包路径:org.objectweb.asm.Type
类名称:Type
方法名:getConstructorDescriptor

Type.getConstructorDescriptor介绍

[英]Returns the descriptor corresponding to the given constructor.
[中]返回与给定构造函数对应的描述符。

代码示例

代码示例来源:origin: org.ow2.asm/asm

/**
 * Returns the method {@link Type} corresponding to the given constructor.
 *
 * @param constructor a {@link Constructor} object.
 * @return the method {@link Type} corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> constructor) {
 return getType(getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.apache.xbean/xbean-finder

public MethodInfo(ClassInfo info, Constructor constructor) {
  super(constructor);
  this.declaringClass = info;
  this.name = "<init>";
  this.descriptor = Type.getConstructorDescriptor(constructor);
}

代码示例来源:origin: EvoSuite/evosuite

public String getNameWithDescriptor() {
  return "<init>" + org.objectweb.asm.Type.getConstructorDescriptor(constructor);
}

代码示例来源:origin: EvoSuite/evosuite

public String getDescriptor() {
  return org.objectweb.asm.Type.getConstructorDescriptor(constructor);
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

/**
 * Returns the method {@link Type} corresponding to the given constructor.
 *
 * @param constructor a {@link Constructor} object.
 * @return the method {@link Type} corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> constructor) {
 return getType(getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.ow2.asm/asm-debug-all

/**
 * Returns the Java method type corresponding to the given constructor.
 * 
 * @param c
 *            a {@link Constructor Constructor} object.
 * @return the Java method type corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> c) {
  return getType(getConstructorDescriptor(c));
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

/**
 * Returns the method {@link Type} corresponding to the given constructor.
 *
 * @param constructor a {@link Constructor} object.
 * @return the method {@link Type} corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> constructor) {
 return getType(getConstructorDescriptor(constructor));
}

代码示例来源:origin: com.bladejava/blade-core

/**
 * Returns the Java method type corresponding to the given constructor.
 * 
 * @param c
 *            a {@link Constructor Constructor} object.
 * @return the Java method type corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> c) {
  return getType(getConstructorDescriptor(c));
}

代码示例来源:origin: com.bladejava/blade-asm

/**
 * Returns the method {@link Type} corresponding to the given constructor.
 *
 * @param constructor a {@link Constructor} object.
 * @return the method {@link Type} corresponding to the given constructor.
 */
public static Type getType(final Constructor<?> constructor) {
 return getType(getConstructorDescriptor(constructor));
}

代码示例来源:origin: net.sourceforge.retroweaver/retroweaver-rt

public boolean testConstructorAccess(Constructor c, int mask) {
  String name = "<init>";
  String desc = org.objectweb.asm.Type.getConstructorDescriptor(c);
  return (methodAccessTable.get(name+desc).intValue() & mask) != 0;
}

代码示例来源:origin: EvoSuite/evosuite

private void writeObject(ObjectOutputStream oos) throws IOException {
  oos.defaultWriteObject();
  // Write/save additional fields
  oos.writeObject(constructor.getDeclaringClass().getName());
  oos.writeObject(org.objectweb.asm.Type.getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.ow2.asm/asm-commons

/**
 * Creates a new {@link Method}.
 *
 * @param constructor a java.lang.reflect constructor descriptor
 * @return a {@link Method} corresponding to the given Java constructor declaration.
 */
public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) {
 return new Method("<init>", Type.getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

/**
 * Creates a new {@link Method}.
 *
 * @param constructor a java.lang.reflect constructor descriptor
 * @return a {@link Method} corresponding to the given Java constructor declaration.
 */
public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) {
 return new Method("<init>", Type.getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

/**
 * Creates a new {@link Method}.
 *
 * @param constructor a java.lang.reflect constructor descriptor
 * @return a {@link Method} corresponding to the given Java constructor declaration.
 */
public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) {
 return new Method("<init>", Type.getConstructorDescriptor(constructor));
}

代码示例来源:origin: org.ow2.asm/asm-debug-all

/**
 * Creates a new {@link Method}.
 * 
 * @param c
 *            a java.lang.reflect constructor descriptor
 * @return a {@link Method} corresponding to the given Java constructor
 *         declaration.
 */
public static Method getMethod(java.lang.reflect.Constructor<?> c) {
  return new Method("<init>", Type.getConstructorDescriptor(c));
}

代码示例来源:origin: puniverse/extended-stacktrace

protected static final String getDescriptor(Member m) {
  if (m instanceof Constructor)
    return Type.getConstructorDescriptor((Constructor) m);
  return Type.getMethodDescriptor((Method) m);
}

代码示例来源:origin: EvoSuite/evosuite

@Override
public String toString() {
  return constructor.getName() + Type.getConstructorDescriptor(constructor.getConstructor());
}

代码示例来源:origin: EvoSuite/evosuite

private void after(ConstructorStatement stmt, Scope scope) {
  String className = stmt.getConstructor().getDeclaringClass().getName();
  String desc = Type.getConstructorDescriptor(stmt.getConstructor().getConstructor());
  /* pops operands if previous code was not instrumented */
  // constructor return type is always VOID
  String onwer = className.replace('.', '/');
  VM.CALL_RESULT(onwer, INIT, desc);
  VariableReference varRef = stmt.getReturnValue();
  ReferenceConstant nonNullRef = (ReferenceConstant) env.topFrame().operandStack.popRef();
  String varName = varRef.getName();
  symb_references.put(varName, nonNullRef);
}

代码示例来源:origin: EvoSuite/evosuite

private void before(ConstructorStatement stmt, Scope scope) {
  String className = stmt.getConstructor().getDeclaringClass().getName();
  VM.NEW(className);
  VM.DUP();
  String desc = Type.getConstructorDescriptor(stmt.getConstructor().getConstructor());
  pushParameterList(stmt.getParameterReferences(), scope, desc);
  String owner = className.replace('.', '/');
  /* indicates if the following code is instrumented or not */
  VM.INVOKESPECIAL(owner, INIT, desc);
  boolean needThis = true;
  call_vm_caller_stack_params(needThis, stmt.getParameterReferences(), scope, desc);
}

代码示例来源:origin: EvoSuite/evosuite

public static String getMethodIdentifier(ExecutionResult result, int exceptionPosition){
  if (result.test.getStatement(exceptionPosition) instanceof MethodStatement) {
    MethodStatement ms = (MethodStatement) result.test.getStatement(exceptionPosition);
    Method method = ms.getMethod().getMethod();
    return method.getName() + Type.getMethodDescriptor(method);
  } else if (result.test.getStatement(exceptionPosition) instanceof ConstructorStatement) {
    ConstructorStatement cs = (ConstructorStatement) result.test.getStatement(exceptionPosition);
    Constructor<?> constructor = cs.getConstructor().getConstructor();
    return  "<init>" + Type.getConstructorDescriptor(constructor);
  }
  return "";
}

相关文章