当前位置: 首页>>代码示例>>Java>>正文


Java DocumentException.getMessage方法代码示例

本文整理汇总了Java中org.dom4j.DocumentException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentException.getMessage方法的具体用法?Java DocumentException.getMessage怎么用?Java DocumentException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dom4j.DocumentException的用法示例。


在下文中一共展示了DocumentException.getMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: nullSafeGet

import org.dom4j.DocumentException; //导入方法依赖的package包/类
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws SQLException {
      Clob clob = rs.getClob(names[0]);
      if (clob==null) return null;
try {
	SAXReader reader = new SAXReader();
	Document document = reader.read(clob.getCharacterStream());
	return document;
} catch (DocumentException e) {
	throw new HibernateException(e.getMessage(),e);
}
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:12,代码来源:XmlClobType.java

示例2: assemble

import org.dom4j.DocumentException; //导入方法依赖的package包/类
public Object assemble(Serializable cached, Object owner) throws HibernateException {
    	try {
            if (cached==null) return null;
    		ByteArrayInputStream in = new ByteArrayInputStream((byte[])cached); 
			SAXReader reader = new SAXReader();
//			GZIPInputStream gzipInput = new GZIPInputStream(in);
			Document document = reader.read(in);
//			gzipInput.close();
    		return document;
		} catch (DocumentException e) {
			throw new HibernateException(e.getMessage(),e);
//    	} catch (IOException e) {
//    		throw new HibernateException(e.getMessage(),e);
    	}
    }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:16,代码来源:XmlClobType.java

示例3: getRequest

import org.dom4j.DocumentException; //导入方法依赖的package包/类
@Override
public Document getRequest(Type requestType) throws IOException {
	Reader reader = iRequest.getReader();
	try {
		return new SAXReader().read(reader);
	} catch (DocumentException e) {
		throw new IOException(e.getMessage(), e);
	} finally {
		reader.close();
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:12,代码来源:XmlApiHelper.java

示例4: main

import org.dom4j.DocumentException; //导入方法依赖的package包/类
/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    QLog.initial(args, 17);
    Locale.setDefault(Locales.getInstance().getLangCurrent());

    // проверить есть ли файл /config/clientboard.xml и если есть отправить его на редактирование
    if (args.length < 2) {
        throw new ServerException("No param '-tcfg' file for context.");
    }
    file = new File(QConfig.cfg().getTabloBoardCfgFile());
    if (!file.exists()) {
        throw new ServerException(
            "File context \"" + QConfig.cfg().getTabloBoardCfgFile() + "\" not exist.");
    }
    QLog.l().logger().info("Load file: " + file.getAbsolutePath());
    final SAXReader reader = new SAXReader(false);
    try {
        root = reader.read(file).getRootElement();
    } catch (DocumentException ex) {
        throw new ServerException("Wrong xml file. " + ex.getMessage());
    }
    /*
     java.awt.EventQueue.invokeLater(new Runnable() {

     @Override
     public void run() {*/
    final FBoardConfig bc = new FBoardConfigImpl(null, false);
    bc.setTitle(bc.getTitle() + " " + file.getAbsolutePath());
    bc.setParams(root);
    Uses.setLocation(bc);
    bc.setVisible(true);
    /*         }
     });*/
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:37,代码来源:TabloRedactor.java

示例5: getEditableDocument1

import org.dom4j.DocumentException; //导入方法依赖的package包/类
Document getEditableDocument1 (String filePath, MetaDataFramework framework) throws Exception, DocumentException {
	String rawXml;
	try {
		rawXml = Files.readFile (filePath).toString();
	} catch (IOException e) {
		throw new Exception (e.getMessage());
	}
	rawXml = SchemEditUtils.expandAmpersands(rawXml);
	// prtln (rawXml);
	Document doc = null;
	try {
		doc = Dom4jUtils.getXmlDocument(rawXml);
	} catch (DocumentException de) {
		throw new Exception (de.getMessage());
	} 
	// pp (doc);
	Element root = doc.getRootElement();
	Attribute schemaLocAtt = root.attribute ("schemaLocation");
	
	if (schemaLocAtt == null) {
		throw new Exception ("couldn't find schemaLocation attribute") ;
	}

	String targetNameSpace = schemaLocAtt.getText().split("\\s")[0];
	// prtln ("Document target namespace: " + targetNameSpace);
	
	String schemaLoc = schemaLocAtt.getText().split("\\s")[1];
	// prtln ("Document schema location: " + schemaLoc);

	String schemaHelperTNS = framework.getSchemaHelper().getTargetNamespace();
	
	if (!targetNameSpace.equals(schemaHelperTNS)) {
		throw new Exception ("document target namespace does not match schema helper (" + schemaHelperTNS + ")");
	}
	
	if (!schemaLoc.equals(framework.getSchemaURI())) {
		throw new Exception ("schema location does not match metadata framework (" + framework.getSchemaURI() + ")");
	}
	
	// doc = Dom4jUtils.localizeXml(doc, root.getName());
	doc = Dom4jUtils.localizeXml(doc);

	pp (doc);
	return doc;
}
 
开发者ID:NCAR,项目名称:joai-project,代码行数:46,代码来源:FrameworkTester.java


注:本文中的org.dom4j.DocumentException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。