1 package org.andromda.metafacades.uml14;
2
3 import java.util.Collection;
4 import org.andromda.core.metafacade.MetafacadeFactory;
5 import org.andromda.metafacades.uml.FilteredCollection;
6 import org.andromda.metafacades.uml.ModelElementFacade;
7 import org.andromda.metafacades.uml.UMLMetafacadeProperties;
8 import org.apache.commons.lang.ObjectUtils;
9 import org.omg.uml.UmlPackage;
10 import org.omg.uml.foundation.core.ModelElement;
11 import org.omg.uml.foundation.core.UmlClass;
12
13
14
15
16
17 public class PackageFacadeLogicImpl
18 extends PackageFacadeLogic
19 {
20 private static final long serialVersionUID = 34L;
21
22
23
24
25 public PackageFacadeLogicImpl(
26 org.omg.uml.modelmanagement.UmlPackage metaObject,
27 String context)
28 {
29 super(metaObject, context);
30 }
31
32
33
34
35 @Override
36 public Collection<UmlClass> handleGetClasses()
37 {
38 return new FilteredCollection(metaObject.getOwnedElement())
39 {
40 private static final long serialVersionUID = 34L;
41 public boolean evaluate(Object object)
42 {
43 return object instanceof UmlClass;
44 }
45 };
46 }
47
48
49
50
51 @Override
52 protected Collection<org.omg.uml.modelmanagement.UmlPackage> handleGetSubPackages()
53 {
54 return new FilteredCollection(metaObject.getOwnedElement())
55 {
56 private static final long serialVersionUID = 34L;
57 public boolean evaluate(Object object)
58 {
59 return object instanceof org.omg.uml.modelmanagement.UmlPackage;
60 }
61 };
62 }
63
64
65
66
67 @Override
68 protected Collection<ModelElement> handleGetModelElements()
69 {
70 return ((UmlPackage)MetafacadeFactory.getInstance().getModel().getModel()).getCore().getModelElement()
71 .refAllOfType();
72 }
73
74
75
76
77 @Override
78 public ModelElementFacade handleFindModelElement(final String fullyQualifiedName)
79 {
80 return (ModelElementFacade)this.shieldedElement(
81 UML14MetafacadeUtils.findByFullyQualifiedName(
82 fullyQualifiedName,
83 ObjectUtils.toString(this.getConfiguredProperty(UMLMetafacadeProperties.NAMESPACE_SEPARATOR)),
84 true));
85 }
86
87
88
89
90 @Override
91 protected Collection handleGetOwnedElements()
92 {
93 return metaObject.getOwnedElement();
94 }
95
96
97
98
99
100 @Override
101 protected String handleGetTablePrefix()
102 {
103
104 return "";
105 }
106 }