IDEADEV-41212: Created an artifact from a folder, then renamed the artifact and it...
[fedora-idea.git] / java / compiler / openapi / src / com / intellij / packaging / elements / PackagingElementFactory.java
blob7401a31d0e555ec99fff74b09cdc76a2d731e3ef
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.packaging.elements;
18 import com.intellij.openapi.components.ServiceManager;
19 import com.intellij.openapi.module.Module;
20 import com.intellij.openapi.roots.libraries.Library;
21 import com.intellij.openapi.project.Project;
22 import com.intellij.packaging.artifacts.Artifact;
23 import com.intellij.packaging.artifacts.ArtifactPointer;
24 import org.jetbrains.annotations.NonNls;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
28 import java.util.List;
30 /**
31 * @author nik
33 public abstract class PackagingElementFactory {
35 public static PackagingElementFactory getInstance() {
36 return ServiceManager.getService(PackagingElementFactory.class);
39 @NotNull
40 public abstract ArtifactRootElement<?> createArtifactRootElement();
42 @NotNull
43 public abstract CompositePackagingElement<?> createDirectory(@NotNull @NonNls String directoryName);
45 @NotNull
46 public abstract CompositePackagingElement<?> createArchive(@NotNull @NonNls String archiveFileName);
48 @NotNull
49 public abstract PackagingElement<?> createModuleOutput(@NotNull String moduleName, Project project);
51 @NotNull
52 public abstract PackagingElement<?> createModuleOutput(@NotNull Module module);
54 @NotNull
55 public abstract List<? extends PackagingElement<?>> createLibraryElements(@NotNull Library library);
57 @NotNull
58 public abstract PackagingElement<?> createArtifactElement(@NotNull ArtifactPointer artifactPointer, @NotNull Project project);
60 @NotNull
61 public abstract PackagingElement<?> createArtifactElement(@NotNull Artifact artifact, @NotNull Project project);
63 @NotNull
64 public abstract PackagingElement<?> createLibraryFiles(@NotNull String libraryName, @NotNull String level, String moduleName);
67 @NotNull
68 public abstract PackagingElement<?> createDirectoryCopyWithParentDirectories(@NotNull String filePath, @NotNull String relativeOutputPath);
70 @NotNull
71 public abstract PackagingElement<?> createFileCopyWithParentDirectories(@NotNull String filePath, @NotNull String relativeOutputPath,
72 @Nullable String outputFileName);
74 @NotNull
75 public abstract PackagingElement<?> createFileCopyWithParentDirectories(@NotNull String filePath, @NotNull String relativeOutputPath);
78 @NotNull
79 public abstract CompositePackagingElement<?> getOrCreateDirectory(@NotNull CompositePackagingElement<?> parent, @NotNull String relativePath);
81 @NotNull
82 public abstract CompositePackagingElement<?> getOrCreateArchive(@NotNull CompositePackagingElement<?> parent, @NotNull String relativePath);
84 public abstract void addFileCopy(@NotNull CompositePackagingElement<?> root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath,
85 final String outputFileName);
87 public abstract void addFileCopy(@NotNull CompositePackagingElement<?> root, @NotNull String outputDirectoryPath, @NotNull String sourceFilePath);
89 @NotNull
90 public abstract PackagingElement<?> createParentDirectories(@NotNull String relativeOutputPath, @NotNull PackagingElement<?> element);
93 @NotNull
94 public abstract List<? extends PackagingElement<?>> createParentDirectories(@NotNull String relativeOutputPath, @NotNull List<? extends PackagingElement<?>> elements);
96 @NotNull
98 public abstract CompositePackagingElementType<?>[] getCompositeElementTypes();
100 @Nullable
101 public abstract PackagingElementType<?> findElementType(String id);
103 @NotNull
104 public abstract PackagingElementType<?>[] getNonCompositeElementTypes();
106 @NotNull
107 public abstract PackagingElementType[] getAllElementTypes();
109 @NotNull
110 public abstract ComplexPackagingElementType<?>[] getComplexElementTypes();