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