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.hocon;
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 HoconSerializer} and {@link HoconParser}.
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://github.com/lightbend/config/blob/main/HOCON.md">HOCON Specification</a>
034 * </ul>
035 */
036@Target({ TYPE, METHOD })
037@Retention(RUNTIME)
038@Inherited
039@ContextApply({ HoconConfigAnnotation.SerializerApply.class, HoconConfigAnnotation.ParserApply.class })
040public @interface HoconConfig {
041
042   /**
043    * Use = for key-value separator.
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 useEqualsSign() 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 useUnquotedStrings() 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 useUnquotedKeys() default "";
077
078   /**
079    * Omit root object braces.
080    *
081    * <ul class='values'>
082    *    <li><js>"true"</js> (default)
083    *    <li><js>"false"</js>
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    * Resolve ${var} substitutions during parsing.
104    *
105    * <ul class='values'>
106    *    <li><js>"true"</js> (default)
107    *    <li><js>"false"</js>
108    * </ul>
109    *
110    * @return The annotation value.
111    */
112   String resolveSubstitutions() default "";
113
114   /**
115    * Optional rank for this config.
116    *
117    * @return The annotation value.
118    */
119   int rank() default 0;
120}