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

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

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom VariableDeclarationFragment 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.databinding.utils.CoreUtils.java

License:Open Source License

/**
 * XXX/*from ww  w .j  a v  a 2  s .c o  m*/
 * 
 * @param <T>
 * @param fragment
 * @param clearProperty
 * @return
 */
@SuppressWarnings("unchecked")
public static <T> T getType(VariableDeclarationFragment fragment, boolean clearProperty) {
    T type = (T) fragment.getProperty(TYPE_PROPERTY);
    Assert.isNotNull(type);
    if (clearProperty) {
        fragment.setProperty(TYPE_PROPERTY, null);
    }
    return type;
}