Examples of XClass


Examples of xjavadoc.XClass

                String sqlName = getSqlNames(tags.iterator());

                extensions.add(new VendorExtension(getVendorName(), "sql-owner-name", sqlName));

                String embeddedClassName = doc.getTagAttributeValue("jdo.field", "element-type");
                XClass embeddedClass = getXJavaDoc().getXClass(embeddedClassName);
                String relatedCollection = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);
                XDoc relatedDoc = embeddedClass.getField(relatedCollection).getDoc();
                Collection targetTags = relatedDoc.getTags(SQL_FIELD_TAG);
                String targetSqlName = getSqlNames(targetTags.iterator());

                extensions.add(new VendorExtension(getVendorName(), "sql-value-name", targetSqlName));
            }
View Full Code Here

Examples of xscript.runtime.clazz.XClass

  public XNativeMethod removeNativeMethod(String name) {
    return nativeMethods.remove(name);
  }

  public void addNativeMethod(String classname, String name, XNativeMethod nativeMethod){
    XClass xClass = virtualMachine.getClassProvider().getLoadedXClass(classname);
    XMethod method = xClass==null?null:xClass.getMethod(name);
    if(method==null){
      if(nativeMethod==null){
        nativeMethods.remove(classname+"."+name);
      }else{
        nativeMethods.put(classname+"."+name, nativeMethod);
View Full Code Here

Examples of xscript.runtime.clazz.XClass

  public XGenericClass getReturnType(XGenericClass genericClass, XGenericMethodProvider methodExecutor){
    return returnType.getXClass(getDeclaringClass().getVirtualMachine(), genericClass, methodExecutor);
  }
 
  public int getReturnTypePrimitive(){
    XClass xClass = returnType.getXClass(getDeclaringClass().getVirtualMachine());
    if(xClass==null)
      return XPrimitive.OBJECT;
    return XPrimitive.getPrimitiveID(xClass);
  }
View Full Code Here

Examples of xscript.runtime.clazz.XClass

 
  public XMethod getMethod(XObject object){
    if(XModifier.isStatic(modifier)){
      return this;
    }
    XClass xClass = object.getXClass().getXClass();
    XClassTable classTable = getDeclaringClass().getClassTable(xClass);
    if(classTable==null){
      throw new XRuntimeException("Can't cast %s to %s", xClass, getDeclaringClass());
    }
    int i = classTable.getMethodID(index);
    return xClass.getVirtualMethod(i);
  }
View Full Code Here

Examples of xscript.runtime.clazz.XClass

  public static void checkAccess(XClass xClass, XClass xClass2){
    if(xClass.getVirtualMachine()!=xClass2.getVirtualMachine()){
      throw new XRuntimeException("%s has a diferent VM than %s", xClass, xClass2);
    }
    int modifier = xClass2.getModifier();
    XClass checkClass1 = xClass;
    while(checkClass1.getOuterClass()!=null){
      checkClass1 = checkClass1.getOuterClass();
    }
    XClass checkClass2 = xClass2;
    while(checkClass2.getOuterClass()!=null){
      checkClass2 = checkClass2.getOuterClass();
    }
    boolean sameOuterClass = checkClass1==checkClass2;
    if(XModifier.isPrivate(modifier)){
      if(!sameOuterClass){
        throw new XRuntimeException("%s can't access %s", xClass, xClass2);
View Full Code Here

Examples of xscript.runtime.clazz.XClass

    if(!xClass.canCastTo(to))
      throw new XRuntimeException("Can't cast %s to %s", xClass, to);
  }

  public static void checkAccess(XClass xClass, XField field) {
    XClass xClass2 = field.getDeclaringClass();
    if(xClass.getVirtualMachine()!=xClass2.getVirtualMachine()){
      throw new XRuntimeException("%s has a diferent VM than %s", xClass, xClass2);
    }
    int modifier = xClass2.getModifier();
    int fModifier = field.getModifier();
    XClass checkClass1 = xClass;
    while(checkClass1.getOuterClass()!=null){
      checkClass1 = checkClass1.getOuterClass();
    }
    XClass checkClass2 = xClass2;
    while(checkClass2.getOuterClass()!=null){
      checkClass2 = checkClass2.getOuterClass();
    }
    boolean sameOuterClass = checkClass1==checkClass2;
    if(XModifier.isPrivate(modifier) || XModifier.isPrivate(fModifier)){
      if(!sameOuterClass){
        throw new XRuntimeException("%s can't access %s", xClass, field);
View Full Code Here

Examples of xscript.runtime.clazz.XClass

      }
    }
  }

  public static void checkAccess(XClass xClass, XMethod method) {
    XClass xClass2 = method.getDeclaringClass();
    if(xClass.getVirtualMachine()!=xClass2.getVirtualMachine()){
      throw new XRuntimeException("%s has a diferent VM than %s", xClass, xClass2);
    }
    int modifier = xClass2.getModifier();
    int fModifier = method.getModifier();
    XClass checkClass1 = xClass;
    while(checkClass1.getOuterClass()!=null){
      checkClass1 = checkClass1.getOuterClass();
    }
    XClass checkClass2 = xClass2;
    while(checkClass2.getOuterClass()!=null){
      checkClass2 = checkClass2.getOuterClass();
    }
    boolean sameOuterClass = checkClass1==checkClass2;
    if(XModifier.isPrivate(modifier) || XModifier.isPrivate(fModifier)){
      if(!sameOuterClass){
        throw new XRuntimeException("%s can't access %s", xClass, method);
View Full Code Here

Examples of xscript.runtime.clazz.XClass

    thread.call(xMethod, solvedGenerics, params);
  }

  private void resolve(XVirtualMachine vm, XMethodExecutor methodExecutor){
    if(method==null){
      XClass xClass = vm.getClassProvider().getXClass(className);
      method = xClass.getMethod(methodName, methodParams, methodReturn);
      XChecks.checkAccess(methodExecutor.getMethod().getDeclaringClass(), method);
      if(generics==null){
        if(method.getGenericParams()!=0)
          throw new XRuntimeException("Can't create a generic method %s without generic params, need %s generic params", method, method.getGenericParams());
      }else if(generics.length!=method.getGenericParams()){
View Full Code Here

Examples of xscript.runtime.clazz.XClass

    long value = field.get(object);
    methodExecutor.push(value, getPrimitiveID(vm));
  }

  private int getPrimitiveID(XVirtualMachine vm){
    XClass xClass = fieldType.getXClass(vm);
    if(xClass==null)
      return XPrimitive.OBJECT;
    return XPrimitive.getPrimitiveID(xClass);
  }
View Full Code Here

Examples of xscript.runtime.clazz.XClass

    return XPrimitive.getPrimitiveID(xClass);
  }
 
  private void resolve(XVirtualMachine vm, XMethodExecutor methodExecutor){
    if(field==null){
      XClass xClass = vm.getClassProvider().getXClass(className);
      field = xClass.getField(fieldName);
      XChecks.checkAccess(methodExecutor.getMethod().getDeclaringClass(), field);
      if(!field.getType().equals(fieldType)){
        throw new XRuntimeException("Type of field %s has changed", field);
      }
      if(XModifier.isStatic(field.getModifier())){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.