groovy.lang.MetaClass.getTheClass()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(99)

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

MetaClass.getTheClass介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

public PojoMetaClassSite(CallSite site, MetaClass metaClass) {
  super(site, metaClass);
  classInfo = ClassInfo.getClassInfo(metaClass.getTheClass());
  version = classInfo.getVersion();
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver) {
    return  receiver!=null &&
        receiver.getClass() == metaClass.getTheClass() &&
        version == classInfo.getVersion(); // metaClass is still valid
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

public StaticMetaClassSite(CallSite site, MetaClass metaClass) {
  super(site, metaClass);
  classInfo = ClassInfo.getClassInfo(metaClass.getTheClass());
  version = classInfo.getVersion();
}

代码示例来源:origin: org.codehaus.groovy/groovy

public void remove() {
    ensureNext();
    setMetaClass(currentMeta.getTheClass(), currentMeta, null);
    currentMeta = null;
  }
};

代码示例来源:origin: org.codehaus.groovy/groovy

public boolean isGroovyObject() {
  final Object owner = getOwner();
  final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
  return GroovyObject.class.isAssignableFrom(ownerMetaClass.getTheClass());
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object arg1) {
  return receiver == metaClass.getTheClass() // meta class match receiver
    && ((MetaClassImpl)metaClass).getVersion() == version // metaClass still be valid
    && MetaClassHelper.sameClasses(params, arg1);
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object[] args) {
  return receiver == metaClass.getTheClass() // meta class match receiver
    && ((MetaClassImpl)metaClass).getVersion() == version // metaClass still be valid
    && MetaClassHelper.sameClasses(params, args);
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver) {
  return receiver == metaClass.getTheClass() // meta class match receiver
    && ((MetaClassImpl)metaClass).getVersion() == version // metaClass still be valid
    && MetaClassHelper.sameClasses(params);
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected static MetaMethod findOwnMethod(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass, MetaMethod method) {
  // we trick ourselves here
  if (instanceKlazz == metaClass.getTheClass())
   return method;
  MetaMethod ownMethod = metaClass.pickMethod(methodName, arguments);
  if (ownMethod != null) {
    if (method == null)
     method = ownMethod;
    else
     method = mostSpecific(method, ownMethod, instanceKlazz);
  }
  return method;
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object arg1, Object arg2) {
  return receiver == metaClass.getTheClass() // meta class match receiver
    && ((MetaClassImpl)metaClass).getVersion() == version // metaClass still be valid
    && MetaClassHelper.sameClasses(params, arg1, arg2);
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object arg1, Object arg2, Object arg3) {
  return receiver == metaClass.getTheClass() // meta class match receiver
    && ((MetaClassImpl)metaClass).getVersion() == version // metaClass still be valid
    && MetaClassHelper.sameClasses(params, arg1, arg2, arg3);
}

代码示例来源:origin: org.codehaus.groovy/groovy

public Class getTheClass() {
  final Object owner = getOwner();
  final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
  return ownerMetaClass.getTheClass();
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object[] args) {
  return receiver == metaClass.getTheClass() // meta class match receiver
      && ((MetaClassImpl) metaClass).getVersion() == version // metaClass still be valid
      && MetaClassHelper.sameClasses(params, args);
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver) {
  try {
    return receiver.getClass() == metaClass.getTheClass() // meta class match receiver
      && checkPojoMetaClass()
      && MetaClassHelper.sameClasses(params);
  } catch (NullPointerException e) {
    if (receiver == null)
     return checkCall(NullObject.getNullObject());
    throw e;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) {
  try {
    return receiver.getClass() == metaClass.getTheClass() // meta class match receiver
      && checkPojoMetaClass()
      && MetaClassHelper.sameClasses(params, arg1, arg2, arg3, arg4);
  } catch (NullPointerException e) {
    if (receiver == null)
     return checkCall(NullObject.getNullObject(), arg1, arg2, arg3, arg4);
    throw e;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

public Object callConstructor(Object receiver, Object[] args) throws Throwable {
    if (receiver == metaClass.getTheClass()) {
      try {
        return metaClass.invokeConstructor(args);
      } catch (GroovyRuntimeException gre) {
        throw ScriptBytecodeAdapter.unwrap(gre);
      }
    } else {
     return CallSiteArray.defaultCallConstructor(this, (Class)receiver, args);
    }
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object arg1) {
  try {
    return receiver.getClass() == metaClass.getTheClass() // meta class match receiver
      && checkPojoMetaClass()
      && MetaClassHelper.sameClasses(params, arg1);
  } catch (NullPointerException e) {
    if (receiver == null)
     return checkCall(NullObject.getNullObject(), arg1);
    throw e;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

protected final boolean checkCall(Object receiver, Object[] args) {
  try {
    return receiver.getClass() == metaClass.getTheClass() // meta class match receiver
      && checkPojoMetaClass()
      && MetaClassHelper.sameClasses(params, args);
  }
  catch (NullPointerException e) {
    if (receiver == null)
     return checkCall(NullObject.getNullObject(), args);
    throw e;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

public final Object invoke(Object receiver, Object [] args) throws Throwable{
  MetaClassHelper.unwrap(args);
  try {
    return metaMethod.doMethodInvoke(metaClass.getTheClass(), args);
  } catch (GroovyRuntimeException gre) {
    throw ScriptBytecodeAdapter.unwrap(gre);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

public Object callConstructor(Object receiver, Object[] args) throws Throwable {
    try {
      if (receiver == metaClass.getTheClass()
        && version == classInfo.getVersion()) // metaClass still be valid
        return metaClass.invokeConstructor(args);
      else
       return CallSiteArray.defaultCallConstructor(this, receiver, args);
    } catch (GroovyRuntimeException gre) {
      throw ScriptBytecodeAdapter.unwrap(gre);
    }
  }
}

相关文章