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

org.androidtransfuse.adapter.ASTBase Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2011-2015 John Ericksen
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.androidtransfuse.adapter;

import com.google.common.collect.ImmutableSet;

import java.lang.annotation.Annotation;

/**
 * Base class defining shared Abstract Syntax Tree elements
 *
 * @author John Ericksen
 */
public interface ASTBase {

    /**
     * Determines if the current element is annotated with the given annotation class
     *
     * @param annotation key
     * @return annotated conditional
     */
    boolean isAnnotated(Class annotation);

    /**
     * Determines if the current element is annotated with the given annotation class
     *
     * @param annotation key
     * @return annotated conditional
     */
    boolean isAnnotated(ASTType annotation);


    /**
     * Supplies the set of annotations
     *
     * @return ast annotation list
     */
    ImmutableSet getAnnotations();

    /**
     * Supplies the given annotation instance from the given annotation class key
     *
     * @param annotation key
     * @param         annotation type
     * @return annotation instance
     */
     A getAnnotation(Class annotation);

    /**
     * Getter for the AST Annotation associated with the given annotation type
     *
     * @param annotation type
     * @return annotation AST
     */
    ASTAnnotation getASTAnnotation(Class annotation);

    /**
     * Supplies the name of the current tree node
     *
     * @return name of the current node
     */
    String getName();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy