本文整理汇总了Java中org.eclipse.uml2.uml.Package.getQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java Package.getQualifiedName方法的具体用法?Java Package.getQualifiedName怎么用?Java Package.getQualifiedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Package
的用法示例。
在下文中一共展示了Package.getQualifiedName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFragmentedPackageList
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
*
* 모델에 포함된 단편화 패키지 목록을 반환 한다.
*
* @param model
* @return TreeMap<String,Package>
*/
public static TreeMap<String, Package> getFragmentedPackageList(Package model) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(pkg.getQualifiedName(), pkg);
continue;
}
}
return packageList;
}
示例2: getFragmentPackages
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
public static TreeMap<String, Package> getFragmentPackages(final Model model) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
continue;
}
}
return packageList;
}
示例3: selectQuery
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
private static TreeMap<String, Package> selectQuery(Resource resource) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
if (model == null)
return packageList;
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
}
return packageList;
}
示例4: getTargetBasePackage
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
* Source모델(분석 모델) 요소 기반으로 Target모델(설계 모델)의 Base 패키지를 찾는 메소드
*
* @param sourceElement
* @param transformationData
* @return Package
*/
private static Package getTargetBasePackage(Element sourceElement, MDADesignerTransformationData transformationData) {
// null 확인
if (sourceElement == null || sourceElement.getModel() == null || !isValid(transformationData)) {
return null;
}
// Source모델(분석 모델) 가져오기
Model sourceModel = null;
if (transformationData.getSourceModelURI() != null) {
sourceModel = DomainModelHandlerUtil.openModel(transformationData.getSourceModelURI());
}
// Source모델(분석 모델) null 확인
if (!sourceModel.getName().equals(sourceElement.getModel().getName())) {// ||
// !(transformationData.getSourceModel().getName().equals(sourceElement.getModel().getName()))
return null;
}
// Model targetModel = transformationData.getTargetModel();
// Target모델(설계 모델) 가져오기
Model targetModel = null;
if (transformationData.getTargetModelURI() != null) {
targetModel = DomainModelHandlerUtil.openModel(transformationData.getTargetModelURI());
}
// Target모델(설계 모델) Base 패키지 획득
Package sourceBase = getBasePackage(sourceElement, transformationData.getRuleSet());
String sourceModelName = sourceBase.getModel().getName();
String sourceBaseQName = sourceBase.getQualifiedName();
String targetBaseQName = targetModel.getName() + sourceBaseQName.substring(sourceModelName.length());
Package targetBase = transformPackage(sourceBase, targetModel, targetBaseQName, false);
return targetBase;
}
示例5: packageFragmentOfResource
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
*
* 리소스에 포함된 단편 개수 void
*/
public static TreeMap<String, Package> packageFragmentOfResource(Resource resource) {
Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
if (model == null)
return packageList;
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
}
}
return packageList;
}
示例6: getFragmentedFileList
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
* file 하위에 존재하는 단편파일 리스트를 가져온다.
*
* @param resource
* void
*/
public static Set<Resource> getFragmentedFileList(Resource resource) {
// List<Resource> resourceList = new ArrayList<Resource>();
//
// org.eclipse.uml2.uml.Package pack = (org.eclipse.uml2.uml.Package) resource.getContents().get(0);
// EObjectCondition condition = new EObjectTypeRelationCondition(EcorePackage.eINSTANCE.getEAnnotation());
// SELECT statement = new SELECT(new FROM(pack), new WHERE(condition));
// IQueryResult result = statement.execute();
//
// EAnnotation annotation;
// for (Iterator<EObject> it = result.iterator(); it.hasNext();) {
// Object obj;
// obj = it.next();
//
// if (obj instanceof EAnnotation) {
// annotation = (EAnnotation) obj;
// if (!(ManagerConstant.UMLDOMAIN_CONSTANT__FRAGMENT_CONTAINER_ANNOTATION_NAME.equals(annotation.getSource()))
// || annotation.eResource() != resource) {
// if (!resourceList.contains(annotation.eResource())) {
// resourceList.add(annotation.eResource());
// }
// }
// }
// }
Set<Resource> resourceList = new HashSet<Resource>();
SELECT statement = new SELECT(new FROM(resource.getContents().get(0)),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
resourceList.add(pkg.eResource());
continue;
}
}
return resourceList;
}
示例7: packageFragmentOfProject
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
*
* 프로젝트에 포함된 단편 개수 void
*/
public static TreeMap<String, Package> packageFragmentOfProject(IProject project) {
TreeMap<String, Package> packageList = new TreeMap<String, Package>();
try {
if (!UMLNature.hasUMLNature(project)) {
return packageList;
}
ResourceSet resourceSet = DomainRegistry.getEditingDomain().getResourceSet();
Map<URI, Resource> uriResourceMap = ((ResourceSetImpl) resourceSet).getURIResourceMap();
for (Iterator<URI> iterator = uriResourceMap.keySet().iterator(); iterator.hasNext();) {
URI uri = (URI) iterator.next();
if (!uri.toString().endsWith("umx")) {
continue;
}
Resource resource = uriResourceMap.get(uri);
IFile file = WorkspaceSynchronizer.getFile(resource);
if (file.getProject() != project) {
continue;
}
Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
if (model == null)
continue;
SELECT statement = new SELECT(new FROM(model),
new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
IQueryResult result = statement.execute();
for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
Package pkg = (Package) ir.next();
if (pkg == null || pkg.getQualifiedName() == null) {
continue;
}
if (AdapterFactoryEditingDomain.isControlled(pkg)) {
packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return packageList;
}