forked from highsource/jaxb-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request highsource#282 from highsource/jt-264-basics
Merge jaxb basics
- Loading branch information
Showing
693 changed files
with
34,394 additions
and
85 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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
**/.classpath | ||
**/.project | ||
**/.settings | ||
target | ||
target |
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,2 @@ | ||
* Register a bug with unboxed fields. | ||
* Add `simplelogger.properties` to samples. |
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,5 @@ | ||
/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,36 @@ | ||
<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> | ||
<artifactId>jaxb2-basics-ant</artifactId> | ||
<packaging>jar</packaging> | ||
<name>JAXB2 Basics - Ant Task</name> | ||
<parent> | ||
<groupId>org.jvnet.jaxb2_commons</groupId> | ||
<artifactId>jaxb2-basics-project</artifactId> | ||
<version>2.0.4-SNAPSHOT</version> | ||
</parent> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-xjc</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.activation</groupId> | ||
<artifactId>jakarta.activation</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.ant</groupId> | ||
<artifactId>ant</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.ant</groupId> | ||
<artifactId>ant-launcher</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<defaultGoal>install</defaultGoal> | ||
</build> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
basics/ant/src/main/java/org/jvnet/jaxb2_commons/xjc/XJC2Task.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,38 @@ | ||
package org.jvnet.jaxb2_commons.xjc; | ||
|
||
import org.apache.tools.ant.BuildException; | ||
|
||
public class XJC2Task extends com.sun.tools.xjc.XJC2Task { | ||
|
||
private boolean disableXmlSecurity = true; | ||
|
||
public void setDisableXmlSecurity(boolean disableXmlSecurity) { | ||
this.disableXmlSecurity = disableXmlSecurity; | ||
} | ||
|
||
private String accessExternalSchema = "all"; | ||
|
||
public void setAccessExternalSchema(String accessExternalSchema) { | ||
this.accessExternalSchema = accessExternalSchema; | ||
} | ||
|
||
private String accessExternalDTD = "all"; | ||
|
||
public void setAccessExternalDTD(String accessExternalDTD) { | ||
this.accessExternalDTD = accessExternalDTD; | ||
} | ||
|
||
@Override | ||
public void execute() throws BuildException { | ||
this.options.disableXmlSecurity = this.disableXmlSecurity; | ||
if (accessExternalSchema != null) { | ||
System.setProperty("javax.xml.accessExternalSchema", | ||
accessExternalSchema); | ||
} | ||
if (accessExternalDTD != null) { | ||
System.setProperty("javax.xml.accessExternalDTD", accessExternalDTD); | ||
} | ||
super.execute(); | ||
} | ||
|
||
} |
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,109 @@ | ||
<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> | ||
<artifactId>jaxb2-basics</artifactId> | ||
<packaging>jar</packaging> | ||
<name>JAXB2 Basics - Basic Plugins</name> | ||
<parent> | ||
<groupId>org.jvnet.jaxb2_commons</groupId> | ||
<artifactId>jaxb2-basics-project</artifactId> | ||
<version>2.0.4-SNAPSHOT</version> | ||
</parent> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jvnet.jaxb2_commons</groupId> | ||
<artifactId>jaxb2-basics-runtime</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jvnet.jaxb2_commons</groupId> | ||
<artifactId>jaxb2-basics-tools</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-runtime</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-xjc</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.javaparser</groupId> | ||
<artifactId>javaparser</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jvnet.jaxb2.maven2</groupId> | ||
<artifactId>maven-jaxb2-plugin-testing</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<profiles> | ||
<profile> | ||
<id>only-eclipse</id> | ||
<activation> | ||
<property> | ||
<name>m2e.version</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> | ||
<plugin> | ||
<groupId>org.eclipse.m2e</groupId> | ||
<artifactId>lifecycle-mapping</artifactId> | ||
<version>1.0.0</version> | ||
<configuration> | ||
<lifecycleMappingMetadata> | ||
<pluginExecutions> | ||
<pluginExecution> | ||
<pluginExecutionFilter> | ||
<groupId> | ||
org.apache.felix | ||
</groupId> | ||
<artifactId> | ||
maven-bundle-plugin | ||
</artifactId> | ||
<versionRange> | ||
[2.3.7,) | ||
</versionRange> | ||
<goals> | ||
<goal>manifest</goal> | ||
</goals> | ||
</pluginExecutionFilter> | ||
<action> | ||
<ignore /> | ||
</action> | ||
</pluginExecution> | ||
<pluginExecution> | ||
<pluginExecutionFilter> | ||
<groupId> | ||
org.jvnet.jaxb2.maven2 | ||
</groupId> | ||
<artifactId> | ||
maven-jaxb2-plugin | ||
</artifactId> | ||
<versionRange> | ||
[0.8.1,) | ||
</versionRange> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
</pluginExecutionFilter> | ||
<action> | ||
<ignore /> | ||
</action> | ||
</pluginExecution> | ||
</pluginExecutions> | ||
</lifecycleMappingMetadata> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</profile> | ||
</profiles> | ||
<build> | ||
<defaultGoal>install</defaultGoal> | ||
</build> | ||
</project> |
18 changes: 18 additions & 0 deletions
18
basics/basic/src/main/java/org/jvnet/jaxb2_commons/plugin/Customizations.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,18 @@ | ||
package org.jvnet.jaxb2_commons.plugin; | ||
|
||
import javax.xml.namespace.QName; | ||
|
||
public class Customizations { | ||
|
||
public static String NAMESPACE_URI = "http://jaxb2-commons.dev.java.net/basic"; | ||
|
||
public static QName GENERATED_ELEMENT_NAME = new QName(NAMESPACE_URI, | ||
"generated"); | ||
|
||
public static QName IGNORED_ELEMENT_NAME = new QName(NAMESPACE_URI, | ||
"ignored"); | ||
|
||
public static QName PROPERTY_ELEMENT_NAME = new QName(NAMESPACE_URI, | ||
"property"); | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
basics/basic/src/main/java/org/jvnet/jaxb2_commons/plugin/CustomizedIgnoring.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,80 @@ | ||
package org.jvnet.jaxb2_commons.plugin; | ||
|
||
import javax.xml.namespace.QName; | ||
|
||
import org.jvnet.jaxb2_commons.util.CustomizationUtils; | ||
|
||
import com.sun.tools.xjc.model.CClassInfo; | ||
import com.sun.tools.xjc.model.CEnumLeafInfo; | ||
import com.sun.tools.xjc.model.CPropertyInfo; | ||
import com.sun.tools.xjc.outline.ClassOutline; | ||
import com.sun.tools.xjc.outline.EnumOutline; | ||
import com.sun.tools.xjc.outline.FieldOutline; | ||
|
||
public class CustomizedIgnoring implements Ignoring { | ||
|
||
private final QName[] ignoredCustomizationElementNames; | ||
|
||
public CustomizedIgnoring(QName... names) { | ||
this.ignoredCustomizationElementNames = names; | ||
} | ||
|
||
public QName[] getIgnoredCustomizationElementNames() { | ||
return ignoredCustomizationElementNames; | ||
} | ||
|
||
public boolean isIgnored(ClassOutline classOutline) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(classOutline, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public boolean isIgnored(EnumOutline enumOutline) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(enumOutline, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public boolean isIgnored(FieldOutline fieldOutline) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(fieldOutline, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public boolean isIgnored(CClassInfo classInfo) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(classInfo, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public boolean isIgnored(CEnumLeafInfo enumLeafInfo) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(enumLeafInfo, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public boolean isIgnored(CPropertyInfo propertyInfo) { | ||
for (QName name : getIgnoredCustomizationElementNames()) { | ||
if (CustomizationUtils.containsCustomization(propertyInfo, name)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
basics/basic/src/main/java/org/jvnet/jaxb2_commons/plugin/Ignoring.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,24 @@ | ||
package org.jvnet.jaxb2_commons.plugin; | ||
|
||
import com.sun.tools.xjc.model.CClassInfo; | ||
import com.sun.tools.xjc.model.CEnumLeafInfo; | ||
import com.sun.tools.xjc.model.CPropertyInfo; | ||
import com.sun.tools.xjc.outline.ClassOutline; | ||
import com.sun.tools.xjc.outline.EnumOutline; | ||
import com.sun.tools.xjc.outline.FieldOutline; | ||
|
||
public interface Ignoring { | ||
|
||
public boolean isIgnored(ClassOutline classOutline); | ||
|
||
public boolean isIgnored(EnumOutline enumOutline); | ||
|
||
public boolean isIgnored(FieldOutline fieldOutline); | ||
|
||
public boolean isIgnored(CClassInfo classInfo); | ||
|
||
public boolean isIgnored(CEnumLeafInfo enumLeafInfo); | ||
|
||
public boolean isIgnored(CPropertyInfo propertyInfo); | ||
|
||
} |
Oops, something went wrong.