View Javadoc
1   /*
2    * Themis: Java Project Framework
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.themis.xanalysis.parser.node;
18  
19  import com.github.javaparser.ast.expr.Name;
20  import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
21  import io.github.tonywasher.joceanus.themis.xanalysis.parser.base.ThemisXAnalysisParserDef;
22  
23  /**
24   * Name.
25   */
26  public class ThemisXAnalysisNodeName
27          extends ThemisXAnalysisBaseNode<Name> {
28      /**
29       * The Name.
30       */
31      private final String theName;
32  
33      /**
34       * The Qualifier.
35       */
36      private final ThemisXAnalysisNodeInstance theQualifier;
37  
38      /**
39       * Constructor.
40       *
41       * @param pParser the parser
42       * @param pName   the name
43       * @throws OceanusException on error
44       */
45      ThemisXAnalysisNodeName(final ThemisXAnalysisParserDef pParser,
46                              final Name pName) throws OceanusException {
47          super(pParser, pName);
48          theName = pName.getIdentifier();
49          theQualifier = pParser.parseNode(pName.getQualifier().orElse(null));
50      }
51  
52      /**
53       * Obtain the name.
54       *
55       * @return the name
56       */
57      public String getName() {
58          return theName;
59      }
60  
61      /**
62       * Obtain the qualifier.
63       *
64       * @return the qualifier
65       */
66      public ThemisXAnalysisNodeInstance getQualifier() {
67          return theQualifier;
68      }
69  }