Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,37 @@ public String getUsage() {
return " -Xhyperjaxb3-ejb: Hyperjaxb3 EJB plugin";
}

private String roundtripTestClassName;
@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "roundtripTestClassName":
setRoundtripTestClassName(value);
return;
case "persistenceUnitName":
setPersistenceUnitName(value);
return;
case "targetDir":
setTargetDir(new File(value));
return;
case "persistenceXml":
setPersistenceXml(new File(value));
return;
case "applicationContextClassName":
setApplicationContextClassName(value);
return;
case "maxIdentifierLength":
setMaxIdentifierLength(Integer.parseInt(value));
return;
case "result":
setResult(value);
return;
default:
super.setProperty(propertyName, value);
}
}


private String roundtripTestClassName;

public String getRoundtripTestClassName() {
return roundtripTestClassName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ public String getOptionName() {
public String getUsage() {
return "TBD";
}
@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "defaultFieldTarget":
setDefaultFieldTarget(value);
return;
default:
super.setProperty(propertyName, value);
}
}

private String defaultFieldTarget = "getter";

Expand Down
4 changes: 0 additions & 4 deletions jaxb-plugins-parent/jaxb-plugins-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.io.IOException;

import org.apache.commons.beanutils.BeanUtils;

import com.sun.tools.xjc.BadCommandLineException;
import com.sun.tools.xjc.Options;

Expand Down Expand Up @@ -42,14 +40,22 @@ public int parseArgument(Options opt, String[] args, int start)

final String value = arg.substring(equalsPosition + 1);
consumed++;
try {
BeanUtils.setProperty(this, propertyName, value);
} catch (Exception ex) {
ex.printStackTrace();
throw new BadCommandLineException("Error setting property ["
+ propertyName + "], value [" + value + "].");
}
setProperty(propertyName, value);
}
return consumed;
}

/**
* Set the {@code propertyName} filed of this {@link AbstractParameterizablePlugin} to the specified {@code value}.
* <p>
* This implementation always throws {@link UnsupportedOperationException}.
* It is up to the subclasses of {@link #AbstractParameterizablePlugin()} to property implement this method and
* possibly delegate to this implementation if an unknown property occurs.
*
* @param propertyName the field to set
* @param value the value to set
*/
protected void setProperty(String propertyName, String value) {
throw new UnsupportedOperationException("Cannot set property " + propertyName + " on " + this.getClass().getName());
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jvnet.jaxb.plugin.equals;

import java.io.File;
import java.util.Arrays;
import java.util.Collection;

Expand Down Expand Up @@ -48,6 +49,17 @@ public String getUsage() {
return "TBD";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "equalsStrategyClass":
setEqualsStrategyClass(value);
return;
default:
super.setProperty(propertyName, value);
}
}

private FieldAccessorFactory fieldAccessorFactory = PropertyFieldAccessorFactory.INSTANCE;

public FieldAccessorFactory getFieldAccessorFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ public String getUsage() {
return "TBD";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "hashCodeStrategyClass":
setHashCodeStrategyClass(value);
return;
default:
super.setProperty(propertyName, value);
}
}

private FieldAccessorFactory fieldAccessorFactory = PropertyFieldAccessorFactory.INSTANCE;

public FieldAccessorFactory getFieldAccessorFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public String getUsage() {
return "Change getter for maps to initialize Maps.";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "mapClass":
setMapClass(value);
return;
default:
super.setProperty(propertyName, value);
}
}
private String mapClass = HashMap.class.getName();

public void setMapClass(String mapClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ public String getUsage() {
return "TBD";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "mergeStrategyClass":
setMergeStrategyClass(value);
return;
default:
super.setProperty(propertyName, value);
}
}

private FieldAccessorFactory fieldAccessorFactory = PropertyFieldAccessorFactory.INSTANCE;

public FieldAccessorFactory getFieldAccessorFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public String getUsage() {
return "Generates setters for collections.";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "mode":
setMode(value);
return;
default:
super.setProperty(propertyName, value);
}
}

public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {
for (final ClassOutline classOutline : outline.getClasses())
if (!getIgnoring().isIgnored(classOutline)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ public String getUsage() {
return "TBD";
}

@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "toStringStrategyClass":
setToStringStrategyClass(value);
return;
default:
super.setProperty(propertyName, value);
}
}

private FieldAccessorFactory fieldAccessorFactory = PropertyFieldAccessorFactory.INSTANCE;

public FieldAccessorFactory getFieldAccessorFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ public String getUsage() {
+ " Please visit https://github.com/highsource/jaxb-tools/wiki/JAXB2-Simplify-Plugin"
+ " for plugin documentation.";
}
@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "usePluralForm":
setUsePluralForm(Boolean.parseBoolean(value));
return;
default:
super.setProperty(propertyName, value);
}
}

private Ignoring ignoring = new ComposedIgnoring(
logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ public String getOptionName() {
public String getUsage() {
return "TBD";
}
@Override
protected void setProperty(String propertyName, String value) {
switch (propertyName) {
case "toStringStrategyClass":
setToStringStrategyClass(value);
return;
case "toStringEnums":
setToStringEnums(Boolean.parseBoolean(value));
return;
default:
super.setProperty(propertyName, value);
}
}

private FieldAccessorFactory fieldAccessorFactory = PropertyFieldAccessorFactory.INSTANCE;

Expand Down
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<ant.version>1.10.14</ant.version>
<jaxb.version>4.0.6</jaxb.version>

<commons-beanutils.version>1.11.0</commons-beanutils.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<hamcrest.version>3.0</hamcrest.version>
<hibernate-search.version>4.1.1.Final</hibernate-search.version>
Expand Down Expand Up @@ -356,17 +355,6 @@
</dependency>

<!-- Commons -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Loading