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.uon;
018
019/**
020 * Identifies the possible values for the {@link UonSerializer.Builder#paramFormat(ParamFormat)} setting.
021 *
022 * <h5 class='section'>See Also:</h5><ul>
023 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/UonBasics">UON Basics</a>
024 * </ul>
025 */
026public enum ParamFormat {
027
028   /**
029    * Use UON notation for values.
030    *
031    * <p>
032    * String values such as <js>"(foo='bar')"</js> will end up being quoted and escaped to <js>"'(foo=bar~'baz~')'"</js>.
033    *
034    * <p>
035    * Boolean strings (<js>"true"</js>/<js>"false"</js>) and numeric values (<js>"123"</js>) will also end up quoted
036    * (<js>"'true'"</js>, <js>"'false'"</js>, <js>"'123'"</js>.
037    */
038   UON,
039
040   /**
041    * Serialize as plain text.
042    *
043    * <p>
044    * Strings will never be quoted or escaped.
045    * <br>Maps and array constructs (<js>"(...)"</js>, <js>"@(...)"</js>) will never be used.
046    *
047    * <p>
048    * Note that this can cause errors during parsing if you're using the URL-encoding parser to parse the results since
049    * UON constructs won't be differentiable.
050    * <br>However, this is not an issue if you're simply creating queries or form posts against 3rd-party interfaces.
051    */
052   PLAINTEXT;
053}