001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.jena.annotation; 014 015import static java.lang.annotation.ElementType.*; 016import static java.lang.annotation.RetentionPolicy.*; 017 018import java.lang.annotation.*; 019 020import org.apache.juneau.jena.*; 021 022/** 023 * Annotation for specifying options for RDF serializers. 024 * 025 * <p> 026 * Can be applied to Java packages, types, fields, and methods. 027 * 028 * <p> 029 * Can be used for the following: 030 * <ul> 031 * <li>Override the default behavior of how collections and arrays are serialized. 032 * </ul> 033 */ 034@Documented 035@Target({PACKAGE,TYPE,FIELD,METHOD}) 036@Retention(RUNTIME) 037@Inherited 038public @interface Rdf { 039 040 /** 041 * Marks a bean property as a resource URI identifier for the bean. 042 * 043 * <p> 044 * Has the following effects on the following serializers: 045 * <ul class='spaced-list'> 046 * <li> 047 * {@link RdfSerializer} - Will be rendered as the value of the <js>"rdf:about"</js> attribute 048 * for the bean. 049 * </ul> 050 */ 051 boolean beanUri() default false; 052 053 /** 054 * The format for how collections (e.g. lists and arrays) are serialized in RDF. 055 * 056 * @see RdfCollectionFormat 057 */ 058 RdfCollectionFormat collectionFormat() default RdfCollectionFormat.DEFAULT; 059 060 /** 061 * Sets the namespace URI of this property or class. 062 * 063 * <p> 064 * Must be matched with a {@link #prefix() @Rdf.prefix()} annotation on this object, a parent object, or a {@link RdfNs @RdfNs} with the 065 * same name through the {@link RdfSchema#rdfNs() @RdfSchema.rdfNs()} annotation on the package. 066 */ 067 String namespace() default ""; 068 069 /** 070 * Sets the XML prefix of this property or class. 071 * 072 * <p> 073 * Must either be matched to a {@link #namespace() @Rdf.namespace()} annotation on the same object, parent object, or a {@link RdfNs @RdfNs} 074 * with the same name through the {@link RdfSchema#rdfNs() @RdfSchema.rdfNs()} annotation on the package. 075 */ 076 String prefix() default ""; 077}