Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
91 changed files
with
17,278 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>psidev.psi.ms</groupId> | ||
<artifactId>mzMLValidator</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.2-SNAPSHOT</version> | ||
|
||
<name>PSI mzML semantic validator</name> | ||
<description> | ||
A semantic validator for PSI mzML XMl files. | ||
</description> | ||
|
||
<!-- Additions Florian --> | ||
<properties> | ||
<lib.dir>lib</lib.dir> | ||
</properties> | ||
<!-- Additions Florian --> | ||
|
||
<build> | ||
<!-- fix the versions of the plugins used in the build --> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.5.1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<!-- To compile with JDK5.0 --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.5</source> | ||
<target>1.5</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- Additions Florian --> | ||
<!-- To copy the dependencies from the maven repository to the lib directory --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-dependencies</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/${lib.dir}</outputDirectory> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>false</overWriteSnapshots> | ||
<overWriteIfNewer>true</overWriteIfNewer> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!-- Additions Florian --> | ||
|
||
</plugins> | ||
</build> | ||
|
||
<!-- Additions Florian --> | ||
<profiles> | ||
<profile> | ||
<id>gui-app</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<!-- to create a executable jar to start the MzMLValidatorGUI --> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>psidev.psi.ms.MzMLValidatorGUI</mainClass> | ||
</manifest> | ||
</archive> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<phase>package</phase> <!-- bind to the packaging phase --> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>gui-assembly</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<!-- to create a executable jar to start the MzMLValidatorGUI --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>psidev.psi.ms.MzMLValidatorGUI</mainClass> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>${lib.dir}</classpathPrefix> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>schemaValidation</id> | ||
<build> | ||
<plugins> | ||
<!-- to create a executable jar to start the MzMLSchemaValidator --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>psidev.psi.ms.MzMLSchemaValidator</mainClass> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>${lib.dir}</classpathPrefix> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>commandlineValidator</id> | ||
<build> | ||
<plugins> | ||
<!-- to create a executable jar to start the command line MzMLValidator --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>psidev.psi.ms.MzMLValidator</mainClass> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>${lib.dir}</classpathPrefix> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
<!-- Additions Florian --> | ||
|
||
<repositories> | ||
<!-- removed java.net repositories, these are now mirrored in maven central --> | ||
<!-- EBI repositories --> | ||
<repository> | ||
<id>ebi-repo</id> | ||
<name>The EBI internal repository</name> | ||
<url>http://www.ebi.ac.uk/~maven/m2repo</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>ebi-repo-snapshots</id> | ||
<name>The EBI internal repository</name> | ||
<url>http://www.ebi.ac.uk/~maven/m2repo_snapshots</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>psidev.psi.tools</groupId> | ||
<artifactId>validator</artifactId> | ||
<version>2.0.3-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>uk.ac.ebi.jmzml</groupId> | ||
<artifactId>jmzml</artifactId> | ||
<version>1.6.8-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.9</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>net.java.dev.swing-layout</groupId> | ||
<artifactId>swing-layout</artifactId> | ||
<version>1.0.2</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<distributionManagement> | ||
</distributionManagement> | ||
|
||
</project> |
44 changes: 44 additions & 0 deletions
44
validator/src/main/java/psidev/psi/ms/ClusteredContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package psidev.psi.ms; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import psidev.psi.tools.validator.Context; | ||
|
||
/** | ||
* A context which cluster the different contexts for a same error message | ||
* | ||
*/ | ||
public class ClusteredContext extends Context { | ||
|
||
List<Context> contexts = new ArrayList<Context>(); | ||
|
||
public ClusteredContext(String context) { | ||
super(context); | ||
} | ||
|
||
public ClusteredContext() { | ||
super(null); | ||
} | ||
|
||
public List<Context> getContexts() { | ||
return contexts; | ||
} | ||
|
||
public int getNumberOfContexts() { | ||
return contexts.size(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(128); | ||
|
||
if (!contexts.isEmpty()) { | ||
sb.append(contexts.iterator().next()); | ||
if (contexts.size() > 1) | ||
sb.append(" in " + getNumberOfContexts() + " locations"); | ||
} | ||
|
||
return sb.toString(); | ||
} | ||
} |
Oops, something went wrong.