org.zanata.client.commands.pull
Class XliffStrategy
java.lang.Object
org.zanata.client.commands.pull.AbstractPullStrategy
org.zanata.client.commands.pull.XliffStrategy
- All Implemented Interfaces:
- PullStrategy
public class XliffStrategy
- extends AbstractPullStrategy
- Author:
- Sean Flanigan sflaniga@redhat.com
|
Method Summary |
org.zanata.rest.StringSet |
getExtensions()
Which extensions (eg gettext, comment) does this strategy need to fetch from the server? |
File |
getTransFileToWrite(String docName,
LocaleMapping localeMapping)
Provides the file reference that will be used to write a Translation file
for a given Resource. |
boolean |
needsDocToWriteTrans()
Does this strategy need the source document (Resource) when writing translations? |
void |
writeSrcFile(org.zanata.rest.dto.resource.Resource doc)
|
org.zanata.common.io.FileDetails |
writeTransFile(org.zanata.rest.dto.resource.Resource doc,
String docName,
LocaleMapping localeMapping,
org.zanata.rest.dto.resource.TranslationsResource targetDoc)
pre: docWithLocalName.getName() must match docName if docWithLocalName is not null |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XliffStrategy
protected XliffStrategy(PullOptions opts)
getExtensions
public org.zanata.rest.StringSet getExtensions()
- Description copied from interface:
PullStrategy
- Which extensions (eg gettext, comment) does this strategy need to fetch from the server?
- Returns:
needsDocToWriteTrans
public boolean needsDocToWriteTrans()
- Description copied from interface:
PullStrategy
- Does this strategy need the source document (Resource) when writing translations?
- Returns:
writeSrcFile
public void writeSrcFile(org.zanata.rest.dto.resource.Resource doc)
throws IOException
- Throws:
IOException
getTransFileToWrite
public File getTransFileToWrite(String docName,
LocaleMapping localeMapping)
- Description copied from interface:
PullStrategy
- Provides the file reference that will be used to write a Translation file
for a given Resource. Ideally, this method should be used by concrete
implementations of the strategy to write the file.
- Parameters:
docName - may be null if needsDocToWriteTrans() returns falselocaleMapping - Locale mapping to use.
- Returns:
- A File reference (might not exist physically) to which a Translation
Resource will be written.
writeTransFile
public org.zanata.common.io.FileDetails writeTransFile(org.zanata.rest.dto.resource.Resource doc,
String docName,
LocaleMapping localeMapping,
org.zanata.rest.dto.resource.TranslationsResource targetDoc)
throws IOException
- Description copied from interface:
PullStrategy
- pre: docWithLocalName.getName() must match docName if docWithLocalName is not null
- Parameters:
doc - may be null if needsDocToWriteTrans() returns falsedocName - may be null if needsDocToWriteTrans() returns false
- Returns:
- Details of the file that was written. May be null if the Strategy cannot provide details.
- Throws:
IOException
Copyright © 2013 Zanata Project. All Rights Reserved.