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
;
33 public abstract class PackagingElementFactory
{
35 public static PackagingElementFactory
getInstance() {
36 return ServiceManager
.getService(PackagingElementFactory
.class);
40 public abstract ArtifactRootElement
<?
> createArtifactRootElement();
43 public abstract CompositePackagingElement
<?
> createDirectory(@NotNull @NonNls String directoryName
);
46 public abstract CompositePackagingElement
<?
> createArchive(@NotNull @NonNls String archiveFileName
);
49 public abstract PackagingElement
<?
> createModuleOutput(@NotNull String moduleName
, Project project
);
52 public abstract PackagingElement
<?
> createModuleOutput(@NotNull Module module
);
55 public abstract List
<?
extends PackagingElement
<?
>> createLibraryElements(@NotNull Library library
);
58 public abstract PackagingElement
<?
> createArtifactElement(@NotNull ArtifactPointer artifactPointer
, @NotNull Project project
);
61 public abstract PackagingElement
<?
> createArtifactElement(@NotNull Artifact artifact
, @NotNull Project project
);
64 public abstract PackagingElement
<?
> createLibraryFiles(@NotNull String libraryName
, @NotNull String level
, String moduleName
);
68 public abstract PackagingElement
<?
> createDirectoryCopyWithParentDirectories(@NotNull String filePath
, @NotNull String relativeOutputPath
);
71 public abstract PackagingElement
<?
> createFileCopyWithParentDirectories(@NotNull String filePath
, @NotNull String relativeOutputPath
,
72 @Nullable String outputFileName
);
75 public abstract PackagingElement
<?
> createFileCopyWithParentDirectories(@NotNull String filePath
, @NotNull String relativeOutputPath
);
79 public abstract CompositePackagingElement
<?
> getOrCreateDirectory(@NotNull CompositePackagingElement
<?
> parent
, @NotNull String relativePath
);
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
);
90 public abstract PackagingElement
<?
> createParentDirectories(@NotNull String relativeOutputPath
, @NotNull PackagingElement
<?
> element
);
94 public abstract List
<?
extends PackagingElement
<?
>> createParentDirectories(@NotNull String relativeOutputPath
, @NotNull List
<?
extends PackagingElement
<?
>> elements
);
98 public abstract CompositePackagingElementType
<?
>[] getCompositeElementTypes();
101 public abstract PackagingElementType
<?
> findElementType(String id
);
104 public abstract PackagingElementType
<?
>[] getNonCompositeElementTypes();
107 public abstract PackagingElementType
[] getAllElementTypes();
110 public abstract ComplexPackagingElementType
<?
>[] getComplexElementTypes();