Examples of MetaClass


Examples of com.alvazan.orm.impl.meta.data.MetaClass

      throw new UnsupportedOperationException("not done here yet, need to validate constant type");

    DboColumnMeta metaFieldDbo = typeInfo.getColumnInfo();
    String colFamily = metaFieldDbo.getOwner().getColumnFamily();
    String columnName = metaFieldDbo.getColumnName();
    MetaClass metaClass = metaInfo.getMetaClass(colFamily);
    MetaField metaField = metaClass.getMetaFieldByCol(targetSubclass, columnName);
   
    Field field = metaField.getField();
    Class fieldType = field.getType();
    //Are actual type will never be a primitive because of autoboxing.  When the param
    //is passed in, it becomes an Long, Integer, etc. so we need to convert here
View Full Code Here

Examples of com.draagon.meta.MetaClass

    int i = ref.indexOf( OBJECTREF_SEP, OBJECTREF_PREFIX.length() + 1 );
    if ( i < 0 )
      throw new IllegalArgumentException( "Invalid object reference [" + ref + "]" );

    MetaClass mc = MetaClass.forName( ref.substring( OBJECTREF_PREFIX.length(), i ));

    i += OBJECTREF_SEP.length();
    ArrayList<String> al = new ArrayList<String>();

    while( true )
View Full Code Here

Examples of groovy.lang.MetaClass

        return createCallConstructorSite(callSite, (Class) receiver, args).callConstructor(receiver, args);
    }

    private static CallSite createCallStaticSite(CallSite callSite, Class receiver, Object[] args) {
        CallSite site;
        MetaClass metaClass = InvokerHelper.getMetaClass(receiver);
        if (metaClass instanceof MetaClassImpl) {
            site = ((MetaClassImpl)metaClass).createStaticSite(callSite, args);
        }
        else
          site = new StaticMetaClassSite(callSite, metaClass);
View Full Code Here

Examples of groovy.lang.MetaClass

        replaceCallSite(callSite, site);
        return site;
    }

    private static CallSite createCallConstructorSite(CallSite callSite, Class receiver, Object[] args) {
       MetaClass metaClass = InvokerHelper.getMetaClass(receiver);

       CallSite site;
       if (metaClass instanceof MetaClassImpl) {
           site = ((MetaClassImpl)metaClass).createConstructorSite(callSite, args);
       }
View Full Code Here

Examples of groovy.lang.MetaClass

    private static CallSite createCallCurrentSite(CallSite callSite, GroovyObject receiver, Object[] args, Class sender) {
        CallSite site;
        if (receiver instanceof GroovyInterceptable)
          site = new PogoInterceptableSite(callSite);
        else {
            MetaClass metaClass = receiver.getMetaClass();
            if (receiver.getClass() != metaClass.getTheClass() && !metaClass.getTheClass().isInterface()) {
                site = new PogoInterceptableSite(callSite);
            }
            else
                if (metaClass instanceof MetaClassImpl) {
                    site = ((MetaClassImpl)metaClass).createPogoCallCurrentSite(callSite, sender, args);
View Full Code Here

Examples of groovy.lang.MetaClass

    // for MetaClassImpl we try to pick meta method,
    // otherwise or if method doesn't exist we make call via POJO meta class
    private static CallSite createPojoSite(CallSite callSite, Object receiver, Object[] args) {
        final Class klazz = receiver.getClass();
        MetaClass metaClass = InvokerHelper.getMetaClass(receiver);
        if (!GroovyCategorySupport.hasCategoryInCurrentThread() && metaClass instanceof MetaClassImpl) {
            final MetaClassImpl mci = (MetaClassImpl) metaClass;
            final ClassInfo info = mci.getTheCachedClass().classInfo;
            if (info.hasPerInstanceMetaClasses()) {
                return new PerInstancePojoMetaClassSite(callSite, info);
View Full Code Here

Examples of groovy.lang.MetaClass

    private static CallSite createPogoSite(CallSite callSite, Object receiver, Object[] args) {
        if (receiver instanceof GroovyInterceptable)
          return new PogoInterceptableSite(callSite);

        MetaClass metaClass = ((GroovyObject)receiver).getMetaClass();

        if (metaClass instanceof MetaClassImpl) {
            return ((MetaClassImpl)metaClass).createPogoCallSite(callSite, args);
        }
View Full Code Here

Examples of groovy.lang.MetaClass

    int i = 0;
    for (Object arg : args) {
      argTypes[i++] = arg == null ? null : arg.getClass();
    }

    MetaClass metaClass = target instanceof Class ? InvokerHelper.getMetaClass((Class) target) : InvokerHelper.getMetaClass(target);

    MetaMethod metaMethod = metaClass.pickMethod(method, argTypes);
    if (metaMethod == null) {
      return false;
    }

    Class returnType = metaMethod.getReturnType();
View Full Code Here

Examples of groovy.lang.MetaClass

public class Util {
   
    private static final Object[] EMPTY_OBJECT_ARRAY = {};
   
    static public ReadOnlyProperty getJavaFXProperty(Object instance, String propertyName) {
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        String fxPropertyAccessor = propertyName + "Property";
        if (!mc.respondsTo(instance, fxPropertyAccessor, null).isEmpty()) {
            return (ReadOnlyProperty)InvokerHelper.invokeMethod(instance, fxPropertyAccessor, null);
        }else {
            return null;
        }
    }
View Full Code Here

Examples of groovy.lang.MetaClass

        }
    }
   
    static public boolean isJavaBeanPropertyWritable(Object instance, String propertyName) {
       
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        MetaProperty metaProperty = mc.getMetaProperty(propertyName);
        if(metaProperty != null) {
            String setterName = MetaProperty.getSetterName(propertyName);
            return !mc.respondsTo(instance, setterName, new Class[]{metaProperty.getType()}).isEmpty();
        } else if(instance instanceof Script) {
            return ((Script)instance).getProperty(propertyName) != null;
        }
        return false;
    }
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.