001package org.andromda.metafacades.uml;
002
003import org.andromda.core.profile.Profile;
004
005/**
006 * Contains the common UML AndroMDA profile. That is, it contains elements "common" to all AndroMDA components (tagged
007 * values, stereotypes, and datatypes).
008 *
009 * @author Chad Brandon
010 * @author Bob Fields
011 */
012public class UMLProfile
013{
014    /* ----------------- Stereotypes -------------------- */
015
016    /**
017     * The Profile instance from which we retrieve the mapped profile names.
018     */
019    private static final Profile profile = Profile.instance();
020
021    /**
022     * 'Criteria' Represents a criteria search.
023     */
024    public static final String STEREOTYPE_CRITERIA = profile.get("CRITERIA");
025
026    /**
027     * 'Entity' Represents a persistent entity.
028     */
029    public static final String STEREOTYPE_ENTITY = profile.get("ENTITY");
030
031    /**
032     * 'EmbeddedValue'
033     * Represents an embedded value (typically embedded with an entity as an attribute).
034     */
035    public static final String STEREOTYPE_EMBEDDED_VALUE = profile.get("EMBEDDED_VALUE");
036
037    /**
038     * 'FinderMethod' Represents a finder method on an entity.
039     */
040    public static final String STEREOTYPE_FINDER_METHOD = profile.get("FINDER_METHOD");
041
042    /**
043     * 'Identifier' Represents the primary key of an entity.
044     */
045    public static final String STEREOTYPE_IDENTIFIER = profile.get("IDENTIFIER");
046
047    /**
048     * 'Unique' If an attribute has this stereotype, it is considered unique.
049     */
050    public static final String STEREOTYPE_UNIQUE = profile.get("UNIQUE");
051
052    /**
053     * 'Service' Represents a service.
054     */
055    public static final String STEREOTYPE_SERVICE = profile.get("SERVICE");
056
057    /**
058     * Represents a service class/operation.
059     */
060    public static final String STEREOTYPE_SERVICE_ELEMENT = profile.get("SERVICE_ELEMENT");
061
062    /**
063     * 'ValueObject' Represents a value object.
064     */
065    public static final String STEREOTYPE_VALUE_OBJECT = profile.get("VALUE_OBJECT");
066
067    /**
068     * 'WebFault'
069     * Represents a web service exception (fault). Stereotype a class with this stereotype when it is thrown by a CXF/JAX-WS service.
070     */
071    public static final String STEREOTYPE_WEB_FAULT = profile.get(
072        "WEB_FAULT");
073
074    /**
075     * 'WebService' Represents a web service. Stereotype a class with this stereotype when you want everything on the class to be
076     * exposed as a web service.
077     */
078    public static final String STEREOTYPE_WEBSERVICE = profile.get(
079        "WEBSERVICE");
080
081    /**
082     * 'WebServiceOperation'
083     * Stereotype an operation on a <code>service</code> if you wish to expose the operation.
084     */
085    public static final String STEREOTYPE_WEBSERVICE_OPERATION = profile.get(
086        "WEBSERVICE_OPERATION");
087
088    /**
089     * 'XmlSchema'
090     * Stereotype an operation on a <code>service</code> if you wish to expose the operation.
091     */
092    public static final String STEREOTYPE_XMLSCHEMA = profile.get(
093        "XMLSCHEMA");
094
095    /**
096     * 'Exception'
097     * The base exception stereotype. If a model element is stereotyped with this (or one of its specializations), then
098     * the exception can be generated by a cartridge and a dependency to it from an operation will add a throws clause.
099     */
100    public static final String STEREOTYPE_EXCEPTION = profile.get("EXCEPTION");
101
102    /**
103     * 'Enumeration' Represents an enumeration type.
104     */
105    public static final String STEREOTYPE_ENUMERATION = profile.get("ENUMERATION");
106
107    /**
108     * 'ApplicationException'
109     * Represents exceptions thrown during normal application processing (such as business exceptions). It extends the
110     * base exception stereotype.
111     */
112    public static final String STEREOTYPE_APPLICATION_EXCEPTION = profile.get(
113        "APPLICATION_EXCEPTION");
114
115    /**
116     * 'UnexpectedException'
117     * Represents unexpected exceptions that can occur during application processing. This that a caller isn't expected
118     * to handle.
119     */
120    public static final String STEREOTYPE_UNEXPECTED_EXCEPTION = profile.get(
121        "UNEXPECTED_EXCEPTION");
122
123    /**
124     * 'ExceptionRef'
125     * Represents a reference to an exception model element. Model dependencies to unstereotyped exception model
126     * elements can be stereotyped with this. This allows the user to create a custom exception class since the
127     * exception itself will not be generated but the references to it will be (i.e. the throws clause within an
128     * operation).
129     * Deprecated: In UML2, design the operation to throw the declared exceptions instead of drawing a dependency.
130     */
131    public static final String STEREOTYPE_EXCEPTION_REF = profile.get("EXCEPTION_REF");
132
133    /**
134     * 'Nullable'
135     * Used to indicate whether or not a parameter is nullable (since parameters do <strong>NOT </strong> allow
136     * specification of multiplicity.
137     * Deprecated: Use the parameter multiplicity lowerBound=0 instead
138     */
139    public static final String STEREOTYPE_NULLABLE = profile.get("NULLABLE");
140
141    /**
142     * 'Manageable' Represents a manageable entity.
143     */
144    public static final String STEREOTYPE_MANAGEABLE = profile.get("MANAGEABLE");
145
146    /**
147     * 'Transient' Indicates if a persistence type's property is transient.
148     */
149    public static final String STEREOTYPE_TRANSIENT = profile.get("TRANSIENT");
150
151    /**
152     * 'FrontEndUseCase'
153     * Represents a "front end" use case (that is a use case used to model a presentation tier or "front end").
154     */
155    public static final String STEREOTYPE_FRONT_END_USECASE = profile.get(
156        "FRONT_END_USE_CASE");
157
158    /**
159     * 'FrontEndApplication'
160     * Represents a "front end" use case that is the entry point to the presentation tier.
161     */
162    public static final String STEREOTYPE_FRONT_END_APPLICATION = profile.get(
163        "FRONT_END_APPLICATION");
164
165    /**
166     * 'FrontEndView'
167     * Represents a "front end" view (that is it can represent a JSP page, etc).
168     */
169    public static final String STEREOTYPE_FRONT_END_VIEW = profile.get(
170        "FRONT_END_VIEW");
171
172    /**
173     * 'FrontEndException'
174     * Represents an exception on a "front-end" view.
175     */
176    public static final String STEREOTYPE_FRONT_END_EXCEPTION = profile.get(
177        "FRONT_END_EXCEPTION");
178
179    /**
180     * 'Queue' Represents a "Queue" message destination.
181     */
182    public static final String STEREOTYPE_QUEUE = profile.get("QUEUE");
183
184    /**
185     * 'Topic' Represents a "Topic" message destination.
186     */
187    public static final String STEREOTYPE_TOPIC = profile.get("TOPIC");
188
189    /**
190     * 'DocOnly' Modeled component is for documentation only. Do not generate code.
191     */
192    public static final String STEREOTYPE_DOC_ONLY = profile.get("DOC_ONLY");
193
194    /**
195     * 'Future' Modeled component will be developed in the Future. Do not generate code.
196     */
197    public static final String STEREOTYPE_FUTURE = profile.get("FUTURE");
198
199    /**
200     * 'Ignore' Modeled component should be ignored. Do not generate code.
201     */
202    public static final String STEREOTYPE_IGNORE = profile.get("IGNORE");
203
204    /**
205     * 'analysis' Modeled component should be ignored. Do not generate code.
206     */
207    public static final String STEREOTYPE_ANALYSIS = profile.get("ANALYSIS");
208
209    /**
210     * 'perspective' Modeled component should be ignored. Do not generate code.
211     */
212    public static final String STEREOTYPE_PERSPECTIVE = profile.get("PERSPECTIVE");
213
214    /* ----------------- Tagged Values -------------------- */
215
216    /**
217     * 'documentation' Represents documentation stored as a tagged value
218     */
219    public static final String TAGGEDVALUE_DOCUMENTATION = profile.get(
220        "DOCUMENTATION");
221
222    /**
223     * 'hyperlinkModel' Represents a model hyperlink stored as a tagged value.
224     */
225    public static final String TAGGEDVALUE_MODEL_HYPERLINK = profile.get(
226        "MODEL_HYPERLINK");
227
228    /**
229     * 'hyperlinkTextActive' Represents an external hyperlink (a website outside of a model).
230     */
231    public static final String TAGGEDVALUE_EXTERNAL_HYPERLINK = profile.get(
232        "EXTERNAL_HYPERLINK");
233
234    /**
235     * 'andromda_persistence_schema' Represents the name of the schema for entity persistence.
236     */
237    public static final String TAGGEDVALUE_PERSISTENCE_SCHEMA = profile.get(
238        "PERSISTENCE_SCHEMA");
239
240    /**
241     * 'andromda_persistence_table' Represents a relational table name for entity persistence.
242     */
243    public static final String TAGGEDVALUE_PERSISTENCE_TABLE = profile.get(
244        "PERSISTENCE_TABLE");
245
246    /**
247     * 'andromda_persistence_column' Represents a relational table column name for entity persistence.
248     */
249    public static final String TAGGEDVALUE_PERSISTENCE_COLUMN = profile.get(
250        "PERSISTENCE_COLUMN");
251
252    /**
253     * 'andromda_persistence_column_length' Represents a relational table column length
254     */
255    public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_LENGTH = profile.get(
256        "PERSISTENCE_COLUMN_LENGTH");
257
258    /**
259     * 'andromda_persistence_column_index' Represents a relational table column index name.
260     */
261    public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_INDEX = profile.get(
262        "PERSISTENCE_COLUMN_INDEX");
263
264    /**
265     * 'andromda_persistence_immutable' Indicates if a persistence type is immutable.
266     */
267    public static final String TAGGEDVALUE_PERSISTENCE_IMMUTABLE = profile.get(
268        "PERSISTENCE_IMMUTABLE");
269
270    /**
271     * 'andromda_persistence_foreign_identifier'
272     * Used on an association end to indicate whether its owning entity should have its identifier also be the foreign
273     * key to the related entity.
274     */
275    public static final String TAGGEDVALUE_PERSISTENCE_FOREIGN_IDENTIFIER = profile.get(
276        "PERSISTENCE_FOREIGN_IDENTIFIER");
277
278    /**
279     * 'andromda_persistence_assigned_identifier'
280     * Used on an identifier to indicate whether or not the identifier is <em>assigned</em> (meaning
281     * that the identifier is manually assigned instead of generated.
282     */
283    public static final String TAGGEDVALUE_PERSISTENCE_ASSIGNED_IDENTIFIER = profile.get(
284        "PERSISTENCE_ASSIGNED_IDENTIFIER");
285
286    /**
287     * 'andromda_persistence_foreignkey_constraint'
288     * Used on an association end to denote to name of the foreign key constraint to use in the database.
289     */
290    public static final String TAGGEDVALUE_PERSISTENCE_FOREIGN_KEY_CONSTRAINT_NAME = profile.get(
291        "PERSISTENCE_FOREIGN_KEY_CONSTRAINT_NAME");
292
293    /**
294     * 'andromda_persistence_joincolumn_order' Specifies the order of columns in JoinColumn annotations
295     * which must match the FK column order for the association, delimited by , or ; or |
296     */
297    public static final String TAGGEDVALUE_PERSISTENCE_JOINCOLUMN_ORDER =
298        profile.get("PERSISTENCE_JOINCOLUMN_ORDER");
299
300    /**
301     * 'andromda_persistence_enumeration_member_variable'
302     * Used to assign an enumeration attribute as a member variable rather than a literal.
303     */
304    public static final String TAGGEDVALUE_PERSISTENCE_ENUMERATION_MEMBER_VARIABLE = profile.get(
305        "PERSISTENCE_ENUMERATION_MEMBER_VARIABLE");
306
307    /**
308     * 'andromda_persistence_enumeration_literal_parameters'
309     * Used on an enumeration literal to define the enumeration literal parameters.
310     */
311    public static final String TAGGEDVALUE_PERSISTENCE_ENUMERATION_LITERAL_PARAMETERS = profile.get(
312        "PERSISTENCE_ENUMERATION_LITERAL_PARAMETERS");
313
314    /**
315     * 'andromda_presentation_controller_usecase'
316     * Used to assign the controller to the activity (when it can not be assigned explicitly).
317     */
318    public static final String TAGGEDVALUE_PRESENTATION_CONTROLLER_USECASE = profile.get(
319        "PRESENTATION_CONTROLLER_USECASE");
320
321    /**
322     * 'andromda_presentation_view_table_columns'
323     * Used to assign the table columns to a collection/array type parameter representing a table.
324     */
325    public static final String TAGGEDVALUE_PRESENTATION_TABLE_COLUMNS = profile.get(
326        "PRESENTATION_TABLE_COLUMNS");
327
328    /**
329     * 'andromda_presentation_view_table'
330     * Used to indicate whether or not a parameter should be considered a table (used when no
331     * table columns are specified).
332     */
333    public static final String TAGGEDVALUE_PRESENTATION_IS_TABLE = profile.get(
334        "PRESENTATION_IS_TABLE");
335
336    /**
337     * 'andromda_presentation_usecase_activity'
338     * Used to associate an activity to a use case (when it can not be assigned explicitly).
339     */
340    public static final String TAGGEDVALUE_PRESENTATION_USECASE_ACTIVITY = profile.get(
341        "PRESENTATION_USECASE_ACTIVITY");
342
343    /**
344     * 'andromda_webservice_style'
345     * Stores the style of a web service (document, wrapped, rpc).
346     */
347    public static final String TAGGEDVALUE_WEBSERVICE_STYLE = profile.get(
348        "WEBSERVICE_STYLE");
349
350    /**
351     * 'andromda_webservice_use' Stores the use of a web service (literal, encoded).
352     */
353    public static final String TAGGEDVALUE_WEBSERVICE_USE = profile.get(
354        "WEBSERVICE_USE");
355
356    /**
357     * 'andromda_webservice_provider' Stores the provider of the web service (RPC, EJB).
358     */
359    public static final String TAGGEDVALUE_WEBSERVICE_PROVIDER = profile.get(
360        "WEBSERVICE_PROVIDER");
361
362    /**
363     * 'andromda_role_name'
364     * Stores the name of the role (if it's different than the name of the actor stereotyped as role)
365     */
366    public static final String TAGGEDVALUE_ROLE_NAME = profile.get("ROLE_NAME");
367
368    /**
369     * 'andromda_serialVersionUID'
370     * Stores the serial version UID to be used for a class. If not specified, it will be calculated
371     * based on the class signature.
372     *
373     * @see org.andromda.metafacades.uml.ClassifierFacade#getSerialVersionUID()
374     */
375    public static final String TAGGEDVALUE_SERIALVERSION_UID = profile.get(
376        "SERIALVERSION_UID");
377
378    /**
379     * 'andromda_manageable_table_displayname'
380     * The attribute to use when referencing this table from another one.
381     */
382    public static final String TAGGEDVALUE_MANAGEABLE_DISPLAY_NAME = profile.get(
383        "MANAGEABLE_DISPLAY_NAME");
384
385    /**
386     * 'andromda_manageable_table_maxlistsize' The maximum number of records to load from the DB at the same time.
387     * From Spring, Bpm4struts profile.xml.
388     */
389    public static final String TAGGEDVALUE_MANAGEABLE_MAXIMUM_LIST_SIZE = profile.get(
390        "MANAGEABLE_MAXIMUM_LIST_SIZE");
391
392    /**
393     * 'andromda_manageable_table_pagesize' The maximum number of records to show at the same time.
394     */
395    public static final String TAGGEDVALUE_MANAGEABLE_PAGE_SIZE = profile.get(
396        "MANAGEABLE_PAGE_SIZE");
397
398    /**
399     * 'andromda_manageable_table_resolveable'
400     * Indicates whether or not the underlying entity keys should be resolved when referencing it.
401     */
402    public static final String TAGGEDVALUE_MANAGEABLE_RESOLVEABLE = profile.get(
403        "MANAGEABLE_RESOLVEABLE");
404
405    /**
406     * 'andromda_persistence_column_uniqueGroup' Indicates the unique constraint name grouping the columns.
407     */
408    public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_UNIQUE_GROUP = profile.get(
409        "COLUMN_UNIQUE_GROUP");
410
411    /**
412     * 'andromda_persistence_associationEnd_uniqueGroup' Indicates the unique constraint name grouping the columns.
413     */
414    public static final String TAGGEDVALUE_PERSISTENCE_ASSOCIATION_END_UNIQUE_GROUP = profile.get(
415        "ASSOCIATION_END_UNIQUE_GROUP");
416
417    /**
418     * 'andromda_persistence_associationEnd_primary'
419     * Indicates whether or not the association end is considered "primary" used for things like indicating
420     * which side of a one-to-one association should get the foreign key.
421     */
422    public static final String TAGGEDVALUE_PERSISTENCE_ASSOCIATION_END_PRIMARY = profile.get(
423        "PERSISTENCE_ASSOCIATION_END_PRIMARY");
424
425    /* ----------------- Data Types -------------------- */
426
427    /**
428     * Used to identify object types in the model, any other type that will be identified as an object must
429     * specialize this type.
430     */
431    public static final String OBJECT_TYPE_NAME = profile.get("OBJECT_TYPE");
432
433    /**
434     * Used to identify collection types in the model, any other type that will be identified as a collection must
435     * specialize this type. NonUnique / NonOrdered Collection. Default=Collection
436     */
437    public static final String COLLECTION_TYPE_NAME = profile.get("COLLECTION_TYPE");
438
439    /**
440     * Used to identify a list type in the model, any other type that will be identified as a list must specialize this
441     * type. NonUnique / Ordered Collection. Default=List
442     */
443    public static final String LIST_TYPE_NAME = profile.get("LIST_TYPE");
444
445    /**
446     * Used to identify a set type in the model, any other type that will be identified as a set must specialize this
447     * type. Unique / NonOrdered Collection. Default=Set
448     */
449    public static final String SET_TYPE_NAME = profile.get("SET_TYPE");
450
451    /**
452     * Used to identify an ordered set type in the model, any other type that will be identified as an ordered set must specialize this
453     * type. Unique / Ordered Collection. Default=SortedSet
454     */
455    public static final String ORDERED_SET_TYPE_NAME = profile.get("ORDERED_SET_TYPE");
456
457    /**
458     * Used to identify a map type in the model, any other type that will be identified as a map type must specialize
459     * this type. Default=Map
460     */
461    public static final String MAP_TYPE_NAME = profile.get("MAP_TYPE");
462
463    /**
464     * Used to identify a map type in the model, any other type that will be identified as a map type must specialize
465     * this type. Default=SortedMap
466     */
467    public static final String ORDERED_MAP_TYPE_NAME = profile.get("ORDERED_MAP_TYPE");
468
469    /**
470     * Used to identify collection types in the model, any other type that will be identified as a collection must
471     * specialize this type. NonUnique / NonOrdered Collection. Default=LinkedList
472     */
473    public static final String COLLECTION_IMPL_TYPE_NAME = profile.get("COLLECTION_IMPL_TYPE");
474
475    /**
476     * Used to identify a list type in the model, any other type that will be identified as a list must specialize this
477     * type. NonUnique / Ordered Collection. Default=ArrayList
478     */
479    public static final String LIST_IMPL_TYPE_NAME = profile.get("LIST_IMPL_TYPE");
480
481    /**
482     * Used to identify a set type in the model, any other type that will be identified as a set must specialize this
483     * type. Unique / NonOrdered Collection. Default=HashSet
484     */
485    public static final String SET_IMPL_TYPE_NAME = profile.get("SET_IMPL_TYPE");
486
487    /**
488     * Used to identify an ordered set type in the model, any other type that will be identified as an ordered set must specialize this
489     * type. Unique / Ordered Collection. Default=SortedSet
490     */
491    public static final String ORDERED_SET_IMPL_TYPE_NAME = profile.get("ORDERED_SET_IMPL_TYPE");
492
493    /**
494     * Used to identify a map type in the model, any other type that will be identified as a map type must specialize
495     * this type. Default=HashMap
496     */
497    public static final String MAP_IMPL_TYPE_NAME = profile.get("MAP_IMPL_TYPE");
498
499    /**
500     * Used to identify a map type in the model, any other type that will be identified as a map type must specialize
501     * this type. Default=SortedMap
502     */
503    public static final String ORDERED_MAP_IMPL_TYPE_NAME = profile.get("ORDERED_MAP_IMPL_TYPE");
504
505    /**
506     * Used to identify date types in the model, any other type that will be identified as a date must specialize this
507     * type. Default=datatype::Date
508     */
509    public static final String DATE_TYPE_NAME = profile.get("DATE_TYPE");
510
511    /**
512     * Used to identify time types in the model, any other type that will be identified as a time must specialize this
513     * type. Default=datatype::Time
514     */
515    public static final String TIME_TYPE_NAME = profile.get("TIME_TYPE");
516
517    /**
518     * Used to identify datetime types in the model. Default=datatype::DateTime
519     */
520    public static final String DATETIME_TYPE_NAME = profile.get("DATETIME_TYPE");
521
522    /**
523     * Used to identify a boolean type in the model, any other type that will be identified as a boolean type must
524     * specialize this type. Default=datatype::boolean
525     */
526    public static final String BOOLEAN_TYPE_NAME = profile.get("BOOLEAN_TYPE");
527    /**
528     * Used to identify a character type in the model, any other type that will be identified as a character type must
529     * specialize this type. Default=datatype::Character
530     */
531    public static final String CHARACTER_TYPE_NAME = profile.get("CHARACTER_TYPE");
532
533    /**
534     * Used to identify a file type in the model, any other type that will be identified as a file type must specialize
535     * this type. Default=datatype::File
536     */
537    public static final String FILE_TYPE_NAME = profile.get("FILE_TYPE");
538
539    /**
540     * Used to identify a Blob type in the model, any other type that will be identified as a Blob type must specialize
541     * this type. Default=datatype::Blob
542     */
543    public static final String BLOB_TYPE_NAME = profile.get("BLOB_TYPE");
544
545    /**
546     * Used to identify a Clob type in the model, any other type that will be identified as a Clob type must specialize
547     * this type. Default=datatype::Clob
548     */
549    public static final String CLOB_TYPE_NAME = profile.get("CLOB_TYPE");
550
551    /**
552     * Used to identify a string type in the model, any other type that will be identified as a string type must
553     * specialize this type. Default=datatype::String
554     */
555    public static final String STRING_TYPE_NAME = profile.get("STRING_TYPE");
556
557    /**
558     * Used to identify a void type in the model, any other type that will be identified as a void type must
559     * specialize this type. Default=datatype::void
560     */
561    public static final String VOID_TYPE_NAME = profile.get("VOID_TYPE");
562
563    /**
564     * Used to identify a double type in the model, any other type that will be identified as a double type must
565     * specialize this type. Default=datatype::Double
566     */
567    public static final String DOUBLE_TYPE_NAME = profile.get("DOUBLE_TYPE");
568
569    /**
570     * Used to identify a float type in the model, any other type that will be identified as a float type must
571     * specialize this type. Default=datatype::Float
572     */
573    public static final String FLOAT_TYPE_NAME = profile.get("FLOAT_TYPE");
574
575    /**
576     * Used to identify a integer type in the model, any other type that will be identified as a integer type must
577     * specialize this type. Default=datatype::Integer
578     */
579    public static final String INTEGER_TYPE_NAME = profile.get("INTEGER_TYPE");
580
581    /**
582     * Used to identify a long type in the model, any other type that will be identified as a long type must
583     * specialize this type. Default=datatype::Long
584     */
585    public static final String LONG_TYPE_NAME = profile.get("LONG_TYPE");
586}