Package org.togglz.core.annotation

Examples of org.togglz.core.annotation.Label


    private final String label;
    private final Class<? extends Annotation> annotation;

    private AnnotationFeatureGroup(Class<? extends Annotation> groupAnnotation) {
        this.annotation = groupAnnotation;
        Label labelAnnotation = groupAnnotation.getAnnotation(Label.class);
        if (labelAnnotation != null) {
            label = labelAnnotation.value();
        } else {
            label = groupAnnotation.getClass().getSimpleName();
        }
    }
View Full Code Here


* @author Eli Abramovitch
*/
public class FeatureAnnotations {

    public static String getLabel(Feature feature) {
        Label label = getAnnotation(feature, Label.class);
        if (label != null) {
            return label.value();
        }
        return feature.name();
    }
View Full Code Here

        assertThat(result, notNullValue());
    }

    @Test
    public void getAnnotationWillReturnNullWhenAnnotationDoesNotExist() throws Exception {
        Label result = FeatureAnnotations.getAnnotation(MyFeature.FEATURE_ENABLED_BY_DEFAULT, Label.class);
        assertThat(result, nullValue());
    }
View Full Code Here

TOP

Related Classes of org.togglz.core.annotation.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.