View Javadoc

1   /*
2    PlantUMLDependencyConstants.java
3    Creation date : 29/08/2010
4    Copyright © Benjamin Croizet (graffity2199@yahoo.fr)
5   
6    This program is free software; you can redistribute it and/or
7    modify it under the terms of the GNU General Public License
8    or GNU Lesser General Public License as published by the
9    Free Software Foundation; either version 3 of the License,
10   or (at your option) any later version.
11  
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16  
17   You should have received copies of the GNU General Public License
18   and GNU Lesser General Public License along with this program;
19   if not, write to the Free Software Foundation, Inc.,
20   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21   http://www.fsf.org/licensing/licenses/gpl.html
22   http://www.gnu.org/licenses/lgpl.html
23   */
24  
25  package net.sourceforge.plantumldependency.cli.constants;
26  
27  import static java.util.Arrays.asList;
28  import static java.util.regex.Pattern.compile;
29  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.ABSTRACT_CLASSES;
30  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.ANNOTATIONS;
31  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.CLASSES;
32  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.ENUMS;
33  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.EXTENSIONS;
34  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.IMPLEMENTATIONS;
35  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.IMPORTS;
36  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.INTERFACES;
37  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.NATIVE_METHODS;
38  import static net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType.STATIC_IMPORTS;
39  import static net.sourceforge.plantumldependency.common.color.HTMLColor.YELLOW;
40  import static net.sourceforge.plantumldependency.common.constants.CharacterConstants.COMMA_CHAR;
41  import static net.sourceforge.plantumldependency.common.constants.CommonConstants.BLANK_STRING;
42  import static net.sourceforge.plantumldependency.common.utils.collection.CollectionUtils.collectionToString;
43  
44  import java.util.Set;
45  import java.util.TreeSet;
46  import java.util.regex.Pattern;
47  
48  import net.sourceforge.plantumldependency.cli.generic.GenericDependency;
49  import net.sourceforge.plantumldependency.cli.generic.impl.GenericDependencyImpl;
50  import net.sourceforge.plantumldependency.cli.generic.type.impl.nativeimpl.NativeDependencyTypeImpl;
51  import net.sourceforge.plantumldependency.cli.main.option.display.type.argument.DisplayType;
52  import net.sourceforge.plantumldependency.cli.plantumldiagram.classes.element.stereotype.PlantUMLStereotype;
53  import net.sourceforge.plantumldependency.cli.plantumldiagram.classes.element.stereotype.impl.PlantUMLSpottedCharacterImpl;
54  import net.sourceforge.plantumldependency.cli.plantumldiagram.classes.element.stereotype.impl.PlantUMLStereotypeImpl;
55  
56  /**
57   * The class which stores all necessary plantUML dependency constants as Strings.
58   *
59   * @author Benjamin Croizet (<a href="mailto:graffity2199@yahoo.fr>graffity2199@yahoo.fr</a>)
60   * @since 1.0.0
61   * @version 1.4.0
62   */
63  public final class PlantUMLDependencyConstants {
64  
65      /** The default display name options as String to apply if not specified. */
66      public static final String DEFAULT_DISPLAY_NAME_OPTIONS_STRING = ".*";
67  
68      /** The default display package name options as Pattern to apply if not specified. */
69      public static final Pattern DEFAULT_DISPLAY_NAME_OPTIONS_PATTERN = compile(DEFAULT_DISPLAY_NAME_OPTIONS_STRING);
70  
71      /** The default display package name options as String to apply if not specified. */
72      public static final String DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_STRING = ".*";
73  
74      /** The default display package name options as Pattern to apply if not specified. */
75      public static final Pattern DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_PATTERN = compile(DEFAULT_DISPLAY_PACKAGE_NAME_OPTIONS_STRING);
76  
77      /** The default display types options to apply if not specified. */
78      public static final Set < DisplayType > DEFAULT_DISPLAY_TYPES_OPTIONS = new TreeSet < DisplayType >(
79              asList(new DisplayType[] {ABSTRACT_CLASSES, ANNOTATIONS, CLASSES, ENUMS, IMPORTS, INTERFACES,
80                      STATIC_IMPORTS, NATIVE_METHODS, IMPLEMENTATIONS, EXTENSIONS}));
81  
82      /** The default display types options argument as a String to apply if not specified. */
83      public static final String DEFAULT_DISPLAY_TYPES_OPTIONS_STRING = collectionToString(DEFAULT_DISPLAY_TYPES_OPTIONS,
84              COMMA_CHAR, BLANK_STRING, BLANK_STRING);
85  
86      /** The default exclude options to apply if not specified. */
87      public static final String DEFAULT_EXCLUDE_OPTIONS = "**/package-info.java";
88  
89      /** The default include options to apply if not specified. */
90      public static final String DEFAULT_INCLUDE_OPTIONS = "**/*.";
91  
92      /** The string representing the "java.lang" package. */
93      public static final String JAVA_LANG_PACKAGE = "java.lang";
94  
95      /** Logging properties path. */
96      public static final String LOGGING_PROPERTIES_PATH = "net/sourceforge/plantumldependency/cli/log/logging.properties";
97  
98      /** The native dependency package name. */
99      public static final String NATIVE_DEPENDENCY_NAME = "NativeCall";
100 
101     /** The native dependency package name. */
102     public static final String NATIVE_DEPENDENCY_PACKAGE_NAME = "javax.native";
103 
104     /** The custom dependency which is used to link with native code. */
105     public static final GenericDependency NATIVE_DEPENDENCY = new GenericDependencyImpl(new NativeDependencyTypeImpl(
106             NATIVE_DEPENDENCY_NAME, NATIVE_DEPENDENCY_PACKAGE_NAME));
107 
108     /** The custom native plantUML stereotype. */
109     public static final PlantUMLStereotype NATIVE_PLANTUML_STEREOTYPE = new PlantUMLStereotypeImpl(
110             new PlantUMLSpottedCharacterImpl('N', YELLOW));
111 
112     /**
113      * Private constructor to prevent from instantiation.
114      *
115      * @since 1.0.0
116      */
117     private PlantUMLDependencyConstants() {
118         super();
119     }
120 }