
com.mysema.rdfbean.annotations.MapElements Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2010 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.rdfbean.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @MapElements defines how Map's keys and values are mapped to RDF. Map's
* are mapped using 1) @Predicate to define target and 2) MapElements to
* define how that object is mapped to Map elements.
*
*
* @Predicate(ns = RDFS.NS, ln = "subClassOf", inv = true)
* @MapElements(key = @Predicate(ns = RDFS.NS, ln = "label"))
* private Map<String, RDFSClass> subClassesByLabel;
*
*
* If the component (value) type is not readable from property's generic
* signature, it can be defined using @ComponentType.
*
* @author sasa
*/
@Documented
@Target({ METHOD, FIELD, PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface MapElements {
// TODO: Refactor into Path
Predicate key();
Class> keyType() default Void.class;
String ns() default "";
// TODO: Refactor into Path
Predicate value() default @Predicate(ns = "");
String context() default "";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy