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

spoon.reflect.reference.CtWildcardReference Maven / Gradle / Ivy

Go to download

Spoon is a tool for meta-programming, analysis and transformation of Java programs.

There is a newer version: 11.1.1-beta-14
Show newest version
/*
 * SPDX-License-Identifier: (MIT OR CECILL-C)
 *
 * Copyright (C) 2006-2023 INRIA and contributors
 *
 * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon.
 */
package spoon.reflect.reference;

import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;
import spoon.reflect.path.CtRole;
import spoon.support.UnsettableProperty;

/**
 * Represents a wildcard in generic type annotations, i.e. the "?" (e.g. the "?" in Collection<?> or Collection<? extends List>).
 */
public interface CtWildcardReference extends CtTypeParameterReference {
	@Override
	CtWildcardReference clone();

	@Override
	@UnsettableProperty
	 C setSimpleName(String simpleName);

	/**
	 * Returns {@code true} if the bounds are in extends clause.
	 * {@code false} means a super clause.
	 */
	@PropertyGetter(role = CtRole.IS_UPPER)
	boolean isUpper();

	/**
	 * Set to {@code true} to write extends clause for bounds types.
	 */
	@PropertySetter(role = CtRole.IS_UPPER)
	 T setUpper(boolean upper);

	/**
	 * A type parameter can have an extends clause which declare
	 * one ({@link CtTypeReference} or more ({@link CtIntersectionTypeReference} references.
	 * 
	 *     // Extends with generics.
	 *     T extends Interface1
	 *     // Intersection type with generics.
	 *     T extends Interface1 & Interface2
	 * 
*/ @PropertyGetter(role = CtRole.BOUNDING_TYPE) @Override CtTypeReference getBoundingType(); /** * Sets the extends clause of the type parameter. */ @PropertySetter(role = CtRole.BOUNDING_TYPE) T setBoundingType(CtTypeReference superType); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy