From 1571e9bc1fffdbfdeece6b31f6ab2bd257fc28c4 Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Fri, 15 Apr 2016 12:38:09 +1000 Subject: [PATCH] Default 'validate' option to CONTENT as in help text (#111) --- .../org/zanata/client/commands/push/PushOptions.java | 3 +++ .../org/zanata/client/commands/push/PushOptionsImpl.java | 9 +++++++++ .../src/main/java/org/zanata/maven/AbstractPushMojo.java | 3 +++ 3 files changed, 15 insertions(+) diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptions.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptions.java index 34b24edd..b2630b57 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptions.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptions.java @@ -26,6 +26,8 @@ import org.zanata.rest.dto.resource.Resource; import org.zanata.rest.dto.resource.TranslationsResource; +import javax.annotation.Nonnull; + /** * Push options for documents that are parsed on the client and transmitted as a * {@link Resource} or {@link TranslationsResource}. @@ -52,6 +54,7 @@ public interface PushOptions extends PushPullOptions { public ImmutableList getFileTypes(); + @Nonnull public String getValidate(); public boolean isMyTrans(); diff --git a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java index bc0a0b20..9a1d6caf 100644 --- a/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java +++ b/zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushOptionsImpl.java @@ -23,12 +23,16 @@ import com.google.common.collect.ImmutableList; import org.kohsuke.args4j.Option; +import org.zanata.adapter.xliff.XliffCommon; import org.zanata.client.commands.AbstractPushPullOptionsImpl; import org.zanata.client.commands.BooleanValueHandler; import org.zanata.client.commands.PushPullType; import org.zanata.client.commands.ZanataCommand; import org.zanata.util.StringUtil; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * @author Sean Flanigan sflaniga@redhat.com @@ -58,6 +62,7 @@ public class PushOptionsImpl extends AbstractPushPullOptionsImpl private String pushType = DEF_PUSH_TYPE; private String sourceLang = "en-US"; + @Nullable private String validate; private boolean myTrans = DEF_MY_TRANS; @@ -250,7 +255,11 @@ void setExcludeLocaleFilenames(boolean excludeLocaleFilenames) { } @Override + @Nonnull public String getValidate() { + if (validate == null) { + return XliffCommon.ValidationType.CONTENT.name(); + } return validate; } diff --git a/zanata-maven-plugin/src/main/java/org/zanata/maven/AbstractPushMojo.java b/zanata-maven-plugin/src/main/java/org/zanata/maven/AbstractPushMojo.java index c06e6965..3ee1a8ad 100644 --- a/zanata-maven-plugin/src/main/java/org/zanata/maven/AbstractPushMojo.java +++ b/zanata-maven-plugin/src/main/java/org/zanata/maven/AbstractPushMojo.java @@ -30,6 +30,8 @@ import org.zanata.client.commands.push.PushOptions; import org.zanata.client.commands.push.RawPushCommand; +import javax.annotation.Nonnull; + /** * @author Sean Flanigan sflaniga@redhat.com @@ -211,6 +213,7 @@ public boolean getExcludeLocaleFilenames() { } @Override + @Nonnull public String getValidate() { return validate; }