1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import org.netbeans.jmi.javamodel.Expression; 22 import org.netbeans.jmi.javamodel.JavaModelPackage; 23 import org.netbeans.jmi.javamodel.Type; 24 import org.netbeans.mdr.storagemodel.StorableObject; 25 26 30 public abstract class ExpressionImpl extends StatementImpl { 31 protected Type type; 32 33 34 public ExpressionImpl(StorableObject o) { 35 super(o); 36 } 37 38 42 public Type getType() { 43 if (isChanged(CHANGED_TYPE)) 44 return type; 45 else { 46 Object semInfo = getParser().getSemanticInfo(getASTree(), this); 47 if (semInfo instanceof Type) { 48 return (Type) semInfo; 49 } else if (semInfo instanceof String ) { 50 return ((JavaModelPackage) refImmediatePackage()).getType().resolve((String )semInfo); 51 } else { 52 return null; 53 } 54 } 55 } 56 57 } 58 | Popular Tags |