當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。