src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CEnumConstant.java

Thu, 24 May 2018 16:44:14 +0800

author
aoqi
date
Thu, 24 May 2018 16:44:14 +0800
changeset 1288
f4ace6971570
parent 0
373ffda63c9a
permissions
-rw-r--r--

Merge

     1 /*
     2  * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.internal.xjc.model;
    28 import com.sun.tools.internal.xjc.model.nav.NClass;
    29 import com.sun.tools.internal.xjc.model.nav.NType;
    30 import com.sun.xml.internal.bind.v2.model.core.EnumConstant;
    32 import com.sun.xml.internal.xsom.XSComponent;
    33 import org.xml.sax.Locator;
    35 /**
    36  * Enumeration constant.
    37  *
    38  * @author Kohsuke Kawaguchi
    39  */
    40 public final class CEnumConstant implements EnumConstant<NType,NClass>, CCustomizable {
    41     /** Name of the constant. */
    42     public final String name;
    43     /** Javadoc comment. Can be null. */
    44     public final String javadoc;
    45     /** Lexical representation of this enum constant. Always non-null. */
    46     private final String lexical;
    48     private CEnumLeafInfo parent;
    50     private final XSComponent source;
    52     private final CCustomizations customizations;
    54     private final Locator locator;
    56     /**
    57      * @param name
    58      */
    59     public CEnumConstant(String name, String javadoc, String lexical, XSComponent source, CCustomizations customizations, Locator loc) {
    60         assert name!=null;
    61         this.name = name;
    62         this.javadoc = javadoc;
    63         this.lexical = lexical;
    64         this.source = source;
    65         this.customizations = customizations;
    66         this.locator = loc;
    67     }
    69     public CEnumLeafInfo getEnclosingClass() {
    70         return parent;
    71     }
    73     /*package*/ void setParent(CEnumLeafInfo parent) {
    74         this.parent = parent;
    75     }
    77     public String getLexicalValue() {
    78         return lexical;
    79     }
    81     public String getName() {
    82         return name;
    83     }
    85     public XSComponent getSchemaComponent() {
    86         return source;
    87     }
    89     public CCustomizations getCustomizations() {
    90         return customizations;
    91     }
    93     public Locator getLocator() {
    94         return locator;
    95     }
    96 }

mercurial