org.apache.maven.plugin.assembly.model.Component Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-assembly-plugin Show documentation
Show all versions of maven-assembly-plugin Show documentation
A Maven plugin to create archives of your project's sources, classes, dependencies etc. from flexible assembly descriptors.
/*
* $Id$
*/
package org.apache.maven.plugin.assembly.model;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import java.util.Date;
/**
* Describes the component layout and packaging.
*
* @version $Revision$ $Date$
*/
public class Component implements java.io.Serializable {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* Field fileSets.
*/
private java.util.List fileSets;
/**
* Field files.
*/
private java.util.List files;
/**
* Field dependencySets.
*/
private java.util.List dependencySets;
/**
* Field repositories.
*/
private java.util.List repositories;
/**
* Field containerDescriptorHandlers.
*/
private java.util.List containerDescriptorHandlers;
//-----------/
//- Methods -/
//-----------/
/**
* Method addContainerDescriptorHandler.
*
* @param containerDescriptorHandlerConfig
*/
public void addContainerDescriptorHandler(ContainerDescriptorHandlerConfig containerDescriptorHandlerConfig)
{
if ( !(containerDescriptorHandlerConfig instanceof ContainerDescriptorHandlerConfig) )
{
throw new ClassCastException( "Component.addContainerDescriptorHandlers(containerDescriptorHandlerConfig) parameter must be instanceof " + ContainerDescriptorHandlerConfig.class.getName() );
}
getContainerDescriptorHandlers().add( containerDescriptorHandlerConfig );
} //-- void addContainerDescriptorHandler(ContainerDescriptorHandlerConfig)
/**
* Method addDependencySet.
*
* @param dependencySet
*/
public void addDependencySet(DependencySet dependencySet)
{
if ( !(dependencySet instanceof DependencySet) )
{
throw new ClassCastException( "Component.addDependencySets(dependencySet) parameter must be instanceof " + DependencySet.class.getName() );
}
getDependencySets().add( dependencySet );
} //-- void addDependencySet(DependencySet)
/**
* Method addFile.
*
* @param fileItem
*/
public void addFile(FileItem fileItem)
{
if ( !(fileItem instanceof FileItem) )
{
throw new ClassCastException( "Component.addFiles(fileItem) parameter must be instanceof " + FileItem.class.getName() );
}
getFiles().add( fileItem );
} //-- void addFile(FileItem)
/**
* Method addFileSet.
*
* @param fileSet
*/
public void addFileSet(FileSet fileSet)
{
if ( !(fileSet instanceof FileSet) )
{
throw new ClassCastException( "Component.addFileSets(fileSet) parameter must be instanceof " + FileSet.class.getName() );
}
getFileSets().add( fileSet );
} //-- void addFileSet(FileSet)
/**
* Method addRepository.
*
* @param repository
*/
public void addRepository(Repository repository)
{
if ( !(repository instanceof Repository) )
{
throw new ClassCastException( "Component.addRepositories(repository) parameter must be instanceof " + Repository.class.getName() );
}
getRepositories().add( repository );
} //-- void addRepository(Repository)
/**
* Method getContainerDescriptorHandlers.
*
* @return java.util.List
*/
public java.util.List getContainerDescriptorHandlers()
{
if ( this.containerDescriptorHandlers == null )
{
this.containerDescriptorHandlers = new java.util.ArrayList();
}
return this.containerDescriptorHandlers;
} //-- java.util.List getContainerDescriptorHandlers()
/**
* Method getDependencySets.
*
* @return java.util.List
*/
public java.util.List getDependencySets()
{
if ( this.dependencySets == null )
{
this.dependencySets = new java.util.ArrayList();
}
return this.dependencySets;
} //-- java.util.List getDependencySets()
/**
* Method getFileSets.
*
* @return java.util.List
*/
public java.util.List getFileSets()
{
if ( this.fileSets == null )
{
this.fileSets = new java.util.ArrayList();
}
return this.fileSets;
} //-- java.util.List getFileSets()
/**
* Method getFiles.
*
* @return java.util.List
*/
public java.util.List getFiles()
{
if ( this.files == null )
{
this.files = new java.util.ArrayList();
}
return this.files;
} //-- java.util.List getFiles()
/**
* Method getRepositories.
*
* @return java.util.List
*/
public java.util.List getRepositories()
{
if ( this.repositories == null )
{
this.repositories = new java.util.ArrayList();
}
return this.repositories;
} //-- java.util.List getRepositories()
/**
* Method removeContainerDescriptorHandler.
*
* @param containerDescriptorHandlerConfig
*/
public void removeContainerDescriptorHandler(ContainerDescriptorHandlerConfig containerDescriptorHandlerConfig)
{
if ( !(containerDescriptorHandlerConfig instanceof ContainerDescriptorHandlerConfig) )
{
throw new ClassCastException( "Component.removeContainerDescriptorHandlers(containerDescriptorHandlerConfig) parameter must be instanceof " + ContainerDescriptorHandlerConfig.class.getName() );
}
getContainerDescriptorHandlers().remove( containerDescriptorHandlerConfig );
} //-- void removeContainerDescriptorHandler(ContainerDescriptorHandlerConfig)
/**
* Method removeDependencySet.
*
* @param dependencySet
*/
public void removeDependencySet(DependencySet dependencySet)
{
if ( !(dependencySet instanceof DependencySet) )
{
throw new ClassCastException( "Component.removeDependencySets(dependencySet) parameter must be instanceof " + DependencySet.class.getName() );
}
getDependencySets().remove( dependencySet );
} //-- void removeDependencySet(DependencySet)
/**
* Method removeFile.
*
* @param fileItem
*/
public void removeFile(FileItem fileItem)
{
if ( !(fileItem instanceof FileItem) )
{
throw new ClassCastException( "Component.removeFiles(fileItem) parameter must be instanceof " + FileItem.class.getName() );
}
getFiles().remove( fileItem );
} //-- void removeFile(FileItem)
/**
* Method removeFileSet.
*
* @param fileSet
*/
public void removeFileSet(FileSet fileSet)
{
if ( !(fileSet instanceof FileSet) )
{
throw new ClassCastException( "Component.removeFileSets(fileSet) parameter must be instanceof " + FileSet.class.getName() );
}
getFileSets().remove( fileSet );
} //-- void removeFileSet(FileSet)
/**
* Method removeRepository.
*
* @param repository
*/
public void removeRepository(Repository repository)
{
if ( !(repository instanceof Repository) )
{
throw new ClassCastException( "Component.removeRepositories(repository) parameter must be instanceof " + Repository.class.getName() );
}
getRepositories().remove( repository );
} //-- void removeRepository(Repository)
/**
* Set
*
* Set of components which filter various container
* descriptors out of
* the normal archive stream, so they can be
* aggregated then added.
*
*
*
* @param containerDescriptorHandlers
*/
public void setContainerDescriptorHandlers(java.util.List containerDescriptorHandlers)
{
this.containerDescriptorHandlers = containerDescriptorHandlers;
} //-- void setContainerDescriptorHandlers(java.util.List)
/**
* Set
*
* Specifies which dependencies to include in the
* assembly. A
* dependencySet is specified by providing one or
* more of
* <dependencySet> subelements.
*
*
*
* @param dependencySets
*/
public void setDependencySets(java.util.List dependencySets)
{
this.dependencySets = dependencySets;
} //-- void setDependencySets(java.util.List)
/**
* Set
*
* Specifies which groups of files to include in
* the assembly. A
* fileSet is specified by providing one or more of
* <fileSet>
* subelements.
*
*
*
* @param fileSets
*/
public void setFileSets(java.util.List fileSets)
{
this.fileSets = fileSets;
} //-- void setFileSets(java.util.List)
/**
* Set
*
* Specifies which single files to include in the
* assembly. A file
* is specified by providing one or more of
* <file>
* subelements.
*
*
*
* @param files
*/
public void setFiles(java.util.List files)
{
this.files = files;
} //-- void setFiles(java.util.List)
/**
* Set
*
* Specifies a set of repositories to include in
* the assembly. A
* repository is specified by providing one or more
* of
* <repository> subelements.
*
*
*
* @param repositories
*/
public void setRepositories(java.util.List repositories)
{
this.repositories = repositories;
} //-- void setRepositories(java.util.List)
private String modelEncoding = "UTF-8";
/**
* Set an encoding used for reading/writing the model.
*
* @param modelEncoding the encoding used when reading/writing the model.
*/
public void setModelEncoding( String modelEncoding )
{
this.modelEncoding = modelEncoding;
}
/**
* @return the current encoding used when reading/writing this model.
*/
public String getModelEncoding()
{
return modelEncoding;
}
}