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

org.eclipse.sisu.bean.BeanProperty Maven / Gradle / Ivy

There is a newer version: 3.0.0-alpha-3
Show newest version
/*******************************************************************************
 * Copyright (c) 2010-present Sonatype, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Stuart McCulloch (Sonatype, Inc.) - initial API and implementation
 *******************************************************************************/
package org.eclipse.sisu.bean;

import java.lang.annotation.Annotation;

import com.google.inject.TypeLiteral;

/**
 * Represents a bean property such as a field or setter method.
 * 
 * 
 * // like...
 * @SomeAnnotation
 * SomeType someProperty;
 * 
 * // ...or...
 * @SomeAnnotation
 * void setSomeProperty( SomeType _someProperty )
 * {
 *     // ...etc...
 * }
 * 
*/ public interface BeanProperty { /** * Returns the property annotation with the specified type. * * @param annotationType The annotation type * @return Property annotation if it exists; otherwise {@code null} */ A getAnnotation( Class annotationType ); /** * Returns the reified generic type of the property; for example {@code TypeLiteral>}. * * @return Reified generic type */ TypeLiteral getType(); /** * Returns the normalized property name excluding the namespace; for example {@code "address"}. * * @return Normalized property name */ String getName(); /** * Sets the property in the given bean to the given value. * * @param bean The bean to update * @param value The value to set */ void set( B bean, T value ); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy