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.hjson;
018
019import static java.lang.annotation.ElementType.*;
020import static java.lang.annotation.RetentionPolicy.*;
021
022import java.lang.annotation.*;
023
024import org.apache.juneau.marshall.*;
025
026/**
027 * Annotation for specifying config properties defined in {@link HjsonSerializer} and {@link HjsonParser}.
028 *
029 * <p>
030 * Used primarily for specifying bean configuration properties on REST classes and methods.
031 *
032 * <h5 class='section'>See Also:</h5><ul>
033 *    <li class='link'><a class="doclink" href="https://hjson.github.io/syntax.html">Hjson Specification</a>
034 * </ul>
035 */
036@Target({ TYPE, METHOD })
037@Retention(RUNTIME)
038@Inherited
039@ContextApply({ HjsonConfigAnnotation.SerializerApply.class, HjsonConfigAnnotation.ParserApply.class })
040public @interface HjsonConfig {
041
042   /**
043    * Use multiline ''' for strings containing newlines.
044    *
045    * <ul class='values'>
046    *    <li><js>"true"</js> (default)
047    *    <li><js>"false"</js>
048    * </ul>
049    *
050    * @return The annotation value.
051    */
052   String useMultilineStrings() default "";
053
054   /**
055    * Omit quotes for simple string values.
056    *
057    * <ul class='values'>
058    *    <li><js>"true"</js> (default)
059    *    <li><js>"false"</js>
060    * </ul>
061    *
062    * @return The annotation value.
063    */
064   String useQuotelessStrings() default "";
065
066   /**
067    * Omit quotes for simple keys.
068    *
069    * <ul class='values'>
070    *    <li><js>"true"</js> (default)
071    *    <li><js>"false"</js>
072    * </ul>
073    *
074    * @return The annotation value.
075    */
076   String useQuotelessKeys() default "";
077
078   /**
079    * Omit root object braces.
080    *
081    * <ul class='values'>
082    *    <li><js>"true"</js>
083    *    <li><js>"false"</js> (default)
084    * </ul>
085    *
086    * @return The annotation value.
087    */
088   String omitRootBraces() default "";
089
090   /**
091    * Use newlines instead of commas between members.
092    *
093    * <ul class='values'>
094    *    <li><js>"true"</js> (default)
095    *    <li><js>"false"</js>
096    * </ul>
097    *
098    * @return The annotation value.
099    */
100   String useNewlineSeparators() default "";
101
102   /**
103    * Optional rank for this config.
104    *
105    * @return The annotation value.
106    */
107   int rank() default 0;
108}