1 package org.andromda.cartridges.ejb3.metafacades;
2
3 import java.text.MessageFormat;
4 import org.andromda.metafacades.uml.UMLProfile;
5 import org.apache.commons.lang.ObjectUtils;
6 import org.apache.commons.lang.StringUtils;
7
8
9
10
11
12
13 public class EJB3EmbeddedValueFacadeLogicImpl
14 extends EJB3EmbeddedValueFacadeLogic
15 {
16 private static final long serialVersionUID = 34L;
17
18
19
20
21 static final String EMBEDDED_VALUE_IMPLEMENTATION_NAME_PATTERN = "embeddedValueImplementationNamePattern";
22
23
24
25
26
27 public EJB3EmbeddedValueFacadeLogicImpl(final Object metaObject, final String context)
28 {
29 super(metaObject, context);
30 }
31
32
33
34
35 @Override
36 protected boolean handleIsImmutable()
37 {
38 boolean immutable = false;
39 Object value = this.findTaggedValue(UMLProfile.TAGGEDVALUE_PERSISTENCE_IMMUTABLE);
40 if (value != null)
41 {
42 immutable = Boolean.valueOf(ObjectUtils.toString(value)).booleanValue();
43 }
44 return immutable;
45 }
46
47
48
49
50 @Override
51 protected String handleGetImplementationName()
52 {
53 return MessageFormat.format(
54 this.getImplementationNamePattern(),
55 StringUtils.trimToEmpty(this.getName()));
56 }
57
58
59
60
61
62
63 private String getImplementationNamePattern()
64 {
65 return String.valueOf(this.getConfiguredProperty(EMBEDDED_VALUE_IMPLEMENTATION_NAME_PATTERN));
66 }
67
68
69
70
71 @Override
72 protected String handleGetFullyQualifiedImplementationName()
73 {
74 return EJB3MetafacadeUtils.getFullyQualifiedName(
75 this.getPackageName(),
76 this.getImplementationName(),
77 null);
78 }
79 }