-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NOTE: po project still not functional due to need for modernization in testing
- Loading branch information
Showing
214 changed files
with
10,246 additions
and
159 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
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
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,4 @@ | ||
target | ||
.settings | ||
.project | ||
.classpath |
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 @@ | ||
/MANIFEST.MF |
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,29 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Created-By: 17.0.3.1 (Oracle Corporation) | ||
Tool: Bnd-1.15.0 | ||
Bnd-LastModified: 1692302035692 | ||
Export-Package: org.jvnet.annox,org.jvnet.annox.annotation;uses:="org.ap | ||
ache.commons.lang3",org.jvnet.annox.io,org.jvnet.annox.model;uses:="org | ||
.apache.commons.lang3,org.jvnet.annox.parser,org.jvnet.annox.reflect,or | ||
g.apache.commons.lang3.builder",org.jvnet.annox.parser;uses:="org.jvnet | ||
.annox.model,org.jvnet.annox.util,org.jvnet.annox.annotation,org.jvnet. | ||
annox,org.apache.commons.lang3",org.jvnet.annox.reader;uses:="org.jvnet | ||
.annox.model,org.jvnet.annox.reflect",org.jvnet.annox.reader.resourced; | ||
uses:="org.apache.commons.lang3,org.jvnet.annox.io,org.jvnet.annox.mode | ||
l,org.jvnet.annox.util,org.jvnet.annox.parser,org.jvnet.annox.reflect,o | ||
rg.jvnet.annox.reader",org.jvnet.annox.reflect;uses:="org.jvnet.annox.r | ||
eader.resourced,org.jvnet.annox.model,org.apache.commons.lang3,org.jvne | ||
t.annox.reader",org.jvnet.annox.util;uses:="org.jvnet.annox,org.apache. | ||
commons.lang3",org.jvnet.annox.xml.bind;uses:="org.jvnet.annox.reflect" | ||
Import-Package: org.apache.commons.lang3;version="3.2.1",org.apache.comm | ||
ons.lang3.builder;version="3.2.1" | ||
Bundle-Version: 2.0.5.SNAPSHOT | ||
Bundle-SymbolicName: org.jvnet.jaxb.annox | ||
Bundle-License: https://github.com/highsource/jaxb-tools/blob/master/LIC | ||
ENSE | ||
Bundle-Description: JAXB Annox is a part of JAXB Tools project which imp | ||
lements support for reading and writing XML annotations. | ||
Bundle-RequiredExecutionEnvironment: J2SE-1.5 | ||
Bundle-Name: JAXB Tools :: JAXB Annox | ||
|
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,107 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.jvnet.jaxb</groupId> | ||
<artifactId>jaxb-annox-parent</artifactId> | ||
<version>2.0.5-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<groupId>org.jvnet.jaxb</groupId> | ||
<artifactId>jaxb-annox</artifactId> | ||
<packaging>jar</packaging> | ||
<name>JAXB Tools :: JAXB Annox</name> | ||
<properties> | ||
<annox.osgi.version>${project.version}</annox.osgi.version> | ||
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-runtime</artifactId> | ||
<version>${jaxb.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.javaparser</groupId> | ||
<artifactId>javaparser</artifactId> | ||
<version>1.0.11</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-search</artifactId> | ||
<version>3.0.0.GA</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.transaction</groupId> | ||
<artifactId>jta</artifactId> | ||
<version>1.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<version>2.2.0</version> | ||
<executions> | ||
<execution> | ||
<id>bundle-manifest</id> | ||
<phase>process-classes</phase> | ||
<goals> | ||
<goal>manifest</goal> | ||
</goals> | ||
<configuration> | ||
<supportedProjectTypes> | ||
<supportedProjectType>jar</supportedProjectType> | ||
</supportedProjectTypes> | ||
<manifestLocation>META-INF</manifestLocation> | ||
<instructions> | ||
<Bundle-Version>${annox.osgi.version}</Bundle-Version> | ||
<Import-Package> | ||
org.apache.commons.lang3;version="3.2.1", | ||
org.apache.commons.lang3.builder;version="3.2.1" | ||
</Import-Package> | ||
<Export-Package> | ||
org.jvnet.annox, | ||
org.jvnet.annox.annotation, | ||
org.jvnet.annox.io, | ||
org.jvnet.annox.model, | ||
org.jvnet.annox.parser, | ||
org.jvnet.annox.reader, | ||
org.jvnet.annox.reader.resourced, | ||
org.jvnet.annox.reflect, | ||
org.jvnet.annox.util, | ||
org.jvnet.annox.xml.bind | ||
</Export-Package> | ||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> | ||
</instructions> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.5</version> | ||
<configuration> | ||
<archive> | ||
<manifestFile>META-INF/MANIFEST.MF</manifestFile> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
jaxb-annox-parent/jaxb-annox/src/main/java/org/jvnet/annox/Constants.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,9 @@ | ||
package org.jvnet.annox; | ||
|
||
public class Constants { | ||
|
||
public static final String NAMESPACE_URI = "http://annox.dev.java.net"; | ||
|
||
public static final String NAMESPACE_URI_PREFIX = NAMESPACE_URI + "/"; | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...jaxb-annox/src/main/java/org/jvnet/annox/annotation/AnnotationClassNotFoundException.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,21 @@ | ||
package org.jvnet.annox.annotation; | ||
|
||
import org.apache.commons.lang3.Validate; | ||
|
||
public class AnnotationClassNotFoundException extends Exception { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private String className; | ||
|
||
public AnnotationClassNotFoundException(String className, Throwable cause) { | ||
super("Annotation class [" + className + "] could not be found.", cause); | ||
Validate.notNull(className); | ||
this.className = className; | ||
} | ||
|
||
public String getClassName() { | ||
return className; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...t/jaxb-annox/src/main/java/org/jvnet/annox/annotation/NoSuchAnnotationFieldException.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,30 @@ | ||
package org.jvnet.annox.annotation; | ||
|
||
import java.lang.annotation.Annotation; | ||
|
||
public class NoSuchAnnotationFieldException extends Exception { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final Class<? extends Annotation> annotationType; | ||
|
||
private final String name; | ||
|
||
public NoSuchAnnotationFieldException( | ||
final Class<? extends Annotation> annotationType, | ||
final String name, Throwable cause) { | ||
super("No such annotation field [" + name + "] in annotation class [" | ||
+ (annotationType == null ? "null" : annotationType.getName()) | ||
+ "].", cause); | ||
this.annotationType = annotationType; | ||
this.name = name; | ||
} | ||
|
||
public Class<? extends Annotation> getAnnotationType() { | ||
return annotationType; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
jaxb-annox-parent/jaxb-annox/src/main/java/org/jvnet/annox/io/NestedIOException.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,35 @@ | ||
package org.jvnet.annox.io; | ||
|
||
import java.io.IOException; | ||
|
||
public class NestedIOException extends IOException { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public NestedIOException(Throwable cause) { | ||
super(); | ||
initCause(cause); | ||
} | ||
|
||
public NestedIOException(String msg, Throwable cause) { | ||
super(msg); | ||
initCause(cause); | ||
} | ||
|
||
public String getMessage() { | ||
return buildMessage(super.getMessage(), getCause()); | ||
} | ||
|
||
public static String buildMessage(String message, Throwable cause) { | ||
if (cause != null) { | ||
StringBuffer buf = new StringBuffer(); | ||
if (message != null) { | ||
buf.append(message).append("; "); | ||
} | ||
buf.append("nested exception is ").append(cause); | ||
return buf.toString(); | ||
} else { | ||
return message; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...nox-parent/jaxb-annox/src/main/java/org/jvnet/annox/japa/parser/AnnotationExprParser.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,54 @@ | ||
package org.jvnet.annox.japa.parser; | ||
|
||
import japa.parser.JavaParser; | ||
import japa.parser.ParseException; | ||
import japa.parser.ast.CompilationUnit; | ||
import japa.parser.ast.body.ClassOrInterfaceDeclaration; | ||
import japa.parser.ast.body.TypeDeclaration; | ||
import japa.parser.ast.expr.AnnotationExpr; | ||
|
||
import java.io.StringReader; | ||
import java.text.MessageFormat; | ||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.Validate; | ||
|
||
public class AnnotationExprParser { | ||
|
||
public List<AnnotationExpr> parse(String text) throws ParseException { | ||
Validate.notNull(text); | ||
final String classText = text + "\n" + "public class Dummy{}"; | ||
final StringReader reader = new StringReader(classText); | ||
final CompilationUnit compilationUnit = JavaParser.parse(reader, true); | ||
final List<TypeDeclaration> typeDeclarations = compilationUnit | ||
.getTypes(); | ||
if (typeDeclarations.size() > 1) { | ||
throw new ParseException( | ||
MessageFormat | ||
.format("Annotation [{0}] could not be parsed, it contains an unexpected type declaration.", | ||
text)); | ||
} | ||
final TypeDeclaration typeDeclaration = typeDeclarations.get(0); | ||
if (!(typeDeclaration instanceof ClassOrInterfaceDeclaration)) { | ||
throw new ParseException(MessageFormat.format( | ||
"Expected [{0}] as type declaration.", | ||
ClassOrInterfaceDeclaration.class.getName())); | ||
} | ||
final ClassOrInterfaceDeclaration classDeclaration = (ClassOrInterfaceDeclaration) typeDeclaration; | ||
if (!"Dummy".equals(classDeclaration.getName())) { | ||
throw new ParseException(MessageFormat.format( | ||
"Expected [{0}] as type declaration.", "Dummy")); | ||
} | ||
|
||
final List<AnnotationExpr> annotations = typeDeclaration | ||
.getAnnotations(); | ||
|
||
if (annotations == null || annotations.isEmpty()) { | ||
throw new ParseException( | ||
MessageFormat | ||
.format("Annotation [{0}] could not be parsed, it does not seem to contain an annotation declaration.", | ||
text)); | ||
} | ||
return annotations; | ||
} | ||
} |
Oops, something went wrong.