本文整理汇总了Java中com.ximpleware.NavException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java NavException.printStackTrace方法的具体用法?Java NavException.printStackTrace怎么用?Java NavException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ximpleware.NavException
的用法示例。
在下文中一共展示了NavException.printStackTrace方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSrcPureText
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到源的纯文本内容
* @param rowId
* 行的唯一标识
* @return 源的纯文本内容;
*/
public String getSrcPureText(String rowId) {
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
VTDNav vn = getVTDNavByRowId(rowId);
try {
VTDUtils vu = new VTDUtils(vn);
vn.push();
vu.pilot(tuXPath + "/source");
String result = getTUPureText(vu.getVTDNav());
vn.pop();
return result;
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
return null;
}
示例2: XliffUtil
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 直接通过 RowID 来定位,适用于最常见的在界面 NatTable 中显示的文本段。
* @param rowID
*/
public XliffUtil(String rowID) {
this.rowID = rowID;
this.xlfFile = RowIdUtil.getFileNameByRowId(rowID);
this.fileXPath = RowIdUtil.getFileXpathByRowId(rowID);
this.tuid = RowIdUtil.getTUIdByRowId(rowID);
this.vg = new VTDGen();
if (vg.parseFile(xlfFile, true)) {
VTDNav vn = vg.getNav();
try {
vu = new VTDUtils(vn);
} catch (NavException e) {
e.printStackTrace();
}
}
}
示例3: setTMXString
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到Tmx的前部分内容
* @return ;
*/
private void setTMXString() {
if (-1 != vtdUtil.pilot("/tmx/body/tu[last()]")) {
try {
VTDNav vn = vtdUtil.getVTDNav();
long l;
l = vn.getElementFragment();
int os = (int) l + (int) (l >> 32);
offset = os;
int len = vn.getXML().length() - os;
tmxBegainString = "";// vn.toRawString(0, os);
tmxEndString = vn.toRawString(os, len);
} catch (NavException e) {
LOGGER.error(" R:Wrong XML format", e);
e.printStackTrace();
}
}
}
示例4: setSrcLang
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* @param srcLang
* the srcLang to set
*/
private void setSrcLang() {
if (-1 != vtdUtil.pilot("/tmx/header")) {
try {
VTDNav vn = vtdUtil.getVTDNav();
int srcLangIndex = vn.getAttrVal("srclang");
if (srcLangIndex != -1) {
this.srcLang = vn.toString(srcLangIndex).trim();
}
} catch (NavException e) {
LOGGER.error("R: Wrong XML format", e);
e.printStackTrace();
}
}
}
示例5: updateAndSave
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 修改翻译单元内容并保存
* @param rowId
* @param subXPath
* @param newValue
* ;
*/
public void updateAndSave(String rowId, String subXPath, String newValue) {
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
String fileName = RowIdUtil.getFileNameByRowId(rowId);
VTDNav vn = vnMap.get(fileName);
try {
VTDUtils vu = new VTDUtils(vn);
XMLModifier xm = vu.update(tuXPath + subXPath, newValue, VTDUtils.CREATE_IF_NOT_EXIST);
saveAndReparse(xm, fileName);
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
}
示例6: getTuProp
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到翻译单元的属性值 ,来自XLFHandler
* @param rowId
* 行的唯一标识
* @param propName
* 属性名
* @return 属性值;
*/
public String getTuProp(String rowId, String propName) {
VTDNav vn = getVTDNavByRowId(rowId);
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
try {
VTDUtils vu = new VTDUtils(vn);
return vu.getValue(tuXPath + "/@" + propName);
} catch (NavException e) {
e.printStackTrace();
logger.error(Messages.getString("qa.QAXmlHandler.logger7"), e);
}
return null;
}
示例7: deleteAndSave
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 删除翻译单元内容并保存
* @param rowId
* @param subXPath
* @param newValue
* ;
*/
private void deleteAndSave(String rowId, String subXPath) {
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
String fileName = RowIdUtil.getFileNameByRowId(rowId);
VTDNav vn = vnMap.get(fileName);
try {
VTDUtils vu = new VTDUtils(vn);
XMLModifier xm = vu.delete(tuXPath + subXPath);
saveAndReparse(xm, fileName);
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
}
示例8: deleteAltTrans
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 删除匹配
* @param xpath
* alter-trans节点中的条件Xpath
*/
public void deleteAltTrans(String xpath) {
Map<String, List<String>> map = RowIdUtil.groupRowIdByFileName(rowIds);
for (Entry<String, List<String>> entry : map.entrySet()) {
try {
VTDUtils vu = new VTDUtils(vnMap.get(entry.getKey()));
xpath = XPATH_ALL_TU + "/alt-trans[" + xpath + "]";
XMLModifier xm = vu.delete(xpath, VTDUtils.PILOT_TO_END);
saveAndReparse(xm, entry.getKey());
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
}
}
示例9: getTgtContent
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到目标的完整内容
* @param rowId
* 行的唯一标识
* @return 目标的完整内容;
*/
public String getTgtContent(String rowId) {
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
VTDNav vn = getVTDNavByRowId(rowId);
try {
VTDUtils vu = new VTDUtils(vn);
return vu.getValue(tuXPath + "/target/text()");
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
return null;
}
示例10: main
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* @param args
* ;
* @throws NavException
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
VTDGen vg = new VTDGen();
if (vg.parseFile(utf_8, true)) {
VTDNav vn = vg.getNav();
try {
VTDUtils vu = new VTDUtils(vn);
} catch (NavException e) {
e.printStackTrace();
}
}
}
示例11: getTuProp
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到翻译单元的属性值
* @param rowId
* 行的唯一标识
* @param propName
* 属性名
* @return 属性值;
*/
public String getTuProp(String rowId, String propName) {
VTDNav vn = getVTDNavByRowId(rowId);
String tuXPath = RowIdUtil.parseRowIdToXPath(rowId);
try {
VTDUtils vu = new VTDUtils(vn);
return vu.getValue(tuXPath + "/@" + propName);
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
}
return null;
}
示例12: printVN
import com.ximpleware.NavException; //导入方法依赖的package包/类
static void printVN(VTDNav vn, boolean bool) {
boolean debug = false || bool;
if (!debug) {
return;
}
try {
long l = vn.getElementFragment();
System.out.println(vn.toString((int) l, (int) (l >> 32)));
} catch (NavException e) {
e.printStackTrace();
}
}
示例13: getVU
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* @param xlfFile
* XLIFF 文件路径
* @return VTDUtils
*/
public static VTDUtils getVU(String xlfFile) {
VTDGen vg = new VTDGen();
if (vg.parseFile(xlfFile, true)) {
VTDNav vn = vg.getNav();
try {
return new VTDUtils(vn);
} catch (NavException e) {
e.printStackTrace();
}
}
return null;
}
示例14: getRowId
import com.ximpleware.NavException; //导入方法依赖的package包/类
/**
* 得到编辑器中一行文本段数据的唯一标识
* @param vn
* VTDNav对象
* @param handler
* XLFHandler对象
* @param fileName
* xliff文件名
* @return 编辑器中唯一标识该行文本段的Id;
* @throws XPathEvalException
*/
public static String getRowId(VTDNav vn, String fileName) throws XPathEvalException {
try {
if (!"trans-unit".equals(vn.toString(vn.getCurrentIndex()))) {
LOGGER.debug(Messages.getString("file.RowIdUtil.logger1"));
throw new XPathEvalException(Messages.getString("file.RowIdUtil.msg1"));
}
vn.push();
int idIdx = vn.getAttrVal("id");
String tuid = idIdx != -1 ? vn.toString(idIdx) : "";
while (!"file".equals(vn.toString(vn.getCurrentIndex()))) { // 找到file节点
if (!vn.toElement(VTDNav.PARENT)) { // 到跟节点都没有找到
LOGGER.error(Messages.getString("file.RowIdUtil.logger2"));
return null;
}
}
int originalIdx = vn.getAttrVal("original");
String original = originalIdx != -1 ? vn.toString(originalIdx) : "";
return fileName + SPLIT_MARK + original + SPLIT_MARK + tuid;
} catch (NavException e) {
LOGGER.error("", e);
e.printStackTrace();
} finally {
vn.pop();
}
return null;
}