Example usage for org.eclipse.jdt.core.dom Type getProperty

List of usage examples for org.eclipse.jdt.core.dom Type getProperty

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom Type getProperty.

Prototype

public final Object getProperty(String propertyName) 

Source Link

Document

Returns the value of the named property of this node, or null if none.

Usage

From source file:org.eclipse.wb.internal.core.utils.ast.AstNodeUtils.java

License:Open Source License

/**
 * @param type//from ww w  .  j  av  a2s.  co  m
 *          the not <code>null</code> {@link Type}
 * 
 * @return the {@link ITypeBinding} for given {@link Type}, may be <code>null</code> if unknown.
 */
public static ITypeBinding getTypeBinding(Type type) {
    Assert.isNotNull(type);
    // try to get binding from property (copy of binding added by DesignerAST)
    {
        ITypeBinding binding = (ITypeBinding) type.getProperty(AstParser.KEY_TYPE_BINDING);
        if (binding != null) {
            return binding;
        }
    }
    // get standard binding, may be "null"
    return type.resolveBinding();
}