View Javadoc
1   package org.codehaus.mojo.jaxb2.javageneration;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  /**
23   * The type of source input used by XJC.
24   * The constants are duplicated in lowercase since Maven's Mojo argument matcher is case sensitive.
25   *
26   * @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>, jGuru Europe AB
27   * @see <a href="https://jaxb.java.net/">The JAXB Reference Implementation</a>
28   * @since 2.0
29   */
30  public enum SourceContentType {
31  
32      /**
33       * <p>Treat input as DTDs (i.e. <a href="http://en.wikipedia.org/wiki/Document_type_definition">Document Type
34       * Definitions</a>). This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
35       */
36      DTD("dtd"),
37  
38      /**
39       * <p>Treat input as DTDs (i.e. <a href="http://en.wikipedia.org/wiki/Document_type_definition">Document Type
40       * Definitions</a>). This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
41       *
42       * @see #DTD
43       */
44      dtd("dtd"),
45  
46      /**
47       * <p>Treat input as W3C XML Schema (i.e. <a href="http://www.w3.org/TR/xmlschema11-1/">Xml Schema Definitions</a>).
48       * This is the standard mode of the XJC (and is recommended by the Codehaus Mojo team as well).</p>
49       */
50      XmlSchema("xmlschema"),
51  
52      /**
53       * <p>Treat input as W3C XML Schema (i.e. <a href="http://www.w3.org/TR/xmlschema11-1/">Xml Schema Definitions</a>).
54       * This is the standard mode of the XJC (and is recommended by the Codehaus Mojo team as well).</p>
55       *
56       * @see #XmlSchema
57       */
58      xmlschema("xmlschema"),
59  
60      /**
61       * <p>Treat input as <a href="http://relaxng.org/">Relax NG</a>.
62       * This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
63       *
64       * @see <a href="http://en.wikipedia.org/wiki/RELAX_NG">Relax NG on WikiPedia</a>
65       */
66      RelaxNG("relaxng"),
67  
68      /**
69       * <p>Treat input as <a href="http://relaxng.org/">Relax NG</a>.
70       * This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
71       *
72       * @see <a href="http://en.wikipedia.org/wiki/RELAX_NG">Relax NG on WikiPedia</a>
73       * @see #RelaxNG
74       */
75      relaxng("relaxng"),
76  
77      /**
78       * <p>Treat input as <a href="https://www.oasis-open.org/committees/relax-ng/compact-20021121.html">Relax
79       * NG with Compact syntax</a>. This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
80       *
81       * @see <a href="http://en.wikipedia.org/wiki/RELAX_NG">Relax NG on WikiPedia</a>
82       */
83      RelaxNGCompact("relaxng-compact"),
84  
85      /**
86       * <p>Treat input as <a href="https://www.oasis-open.org/committees/relax-ng/compact-20021121.html">Relax
87       * NG with Compact syntax</a>. This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
88       *
89       * @see <a href="http://en.wikipedia.org/wiki/RELAX_NG">Relax NG on WikiPedia</a>
90       * @see #RelaxNGCompact
91       */
92      relaxng_compact("relaxng-compact"),
93  
94      /**
95       * <p>Treat input as <a href="https://www.oasis-open.org/committees/relax-ng/compact-20021121.html">Relax
96       * NG with Compact syntax</a>. This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
97       *
98       * @see <a href="http://en.wikipedia.org/wiki/RELAX_NG">Relax NG on WikiPedia</a>
99       * @see #RelaxNGCompact
100      */
101     relaxngcompact("relaxng-compact"),
102 
103     /**
104      * <p>Treat input as <a href="http://relaxng.org/">WSDL</a>, and compile schemas inside it.
105      * This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
106      *
107      * @see <a href="http://www.w3.org/TR/wsdl">Web Services Description Language (WSDL) 1.1</a>
108      */
109     WSDL("wsdl"),
110 
111     /**
112      * <p>Treat input as <a href="http://relaxng.org/">WSDL</a>, and compile schemas inside it.
113      * This option is labelled as "experimental,unsupported" in the XJC documentation.</p>
114      *
115      * @see <a href="http://www.w3.org/TR/wsdl">Web Services Description Language (WSDL) 1.1</a>
116      * @see #WSDL
117      */
118     wsdl("wsdl");
119 
120     // Internal state
121     private String xjcArgument;
122 
123     SourceContentType(final String xjcArgument) {
124         this.xjcArgument = xjcArgument;
125     }
126 
127     /**
128      * @return The XJC argument flag corresponding to this InputType.
129      */
130     public String getXjcArgument() {
131         return xjcArgument;
132     }
133 }