Package groovy.lang

Examples of groovy.lang.MetaProperty


            if (method!=null || mci==null) return;
            Class chosenSender = this.sender;
            if (mci.getTheClass()!= chosenSender && GroovyCategorySupport.hasCategoryInCurrentThread()) {
                chosenSender = mci.getTheClass();
            }
            MetaProperty res = mci.getEffectiveGetMetaProperty(chosenSender, receiver, name, false);
            if (res instanceof MethodMetaProperty) {
                MethodMetaProperty mmp = (MethodMetaProperty) res;
                method = mmp.getMetaMethod();
                insertName = true;
            } else if (res instanceof CachedField) {
View Full Code Here


import groovy.lang.MetaProperty;

public class SetterSlotFactory implements ISlotFactory {
  public ISlot create(Object owner, Type ownerType, String name) {
    MetaProperty property = GroovyRuntimeUtil.getMetaClass(owner).getMetaProperty(name);
    return property != null && MopUtil.isWriteable(property) ? new PropertySlot(owner, ownerType, property) : null;
  }
View Full Code Here

public class CollectionSlotFactory implements ISlotFactory {
  private static final Pattern pluralIESPattern = Pattern.compile(".*[^aeiouy]y", Pattern.CASE_INSENSITIVE);

  public ISlot create(Object owner, Type ownerType, String name) {
    String plural = toPluralForm(name);
    MetaProperty property = GroovyRuntimeUtil.getMetaClass(owner).getMetaProperty(plural);
    return property != null && Collection.class.isAssignableFrom(property.getType()) && MopUtil.isReadable(property) ?
      new CollectionSlot(plural, owner, ownerType, property) : null;
  }
View Full Code Here

TOP

Related Classes of groovy.lang.MetaProperty

Copyright © 2018 www.massapicom. 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.