All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.lang.reflect.features.FeatureReference Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * Copyright 2014 Guidewire Software, Inc.
 */

package gw.lang.reflect.features;

import gw.lang.reflect.IConstructorInfo;
import gw.lang.reflect.IFeatureInfo;
import gw.lang.reflect.IMethodInfo;
import gw.lang.reflect.IPropertyInfo;
import gw.lang.reflect.IType;

import gw.lang.reflect.java.JavaTypes;
import java.util.Iterator;
import java.util.List;

public abstract class FeatureReference implements IFeatureReference
{
  abstract protected Object evaluate( Iterator args );

  abstract protected List getFullArgTypes();

  protected boolean hasReturn()
  {
    IFeatureInfo fi = getFeatureInfo();
    return fi instanceof IMethodInfo
           ? ((IMethodInfo)fi).getReturnType() != JavaTypes.pVOID()
           : fi == null ||
             fi instanceof IConstructorInfo ||
             fi instanceof IPropertyInfo && ((IPropertyInfo)fi).isReadable( fi.getOwnersType() );
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy