1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-25 15:42:08 +01:00
Files
archived-doc-ja/reference/java/functions/java-last-exception-get.xml
2010-03-29 00:47:47 +00:00

91 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka -->
<refentry xml:id="function.java-last-exception-get" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>java_last_exception_get</refname>
<refpurpose>直近の Java 例外を取得する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>java_last_exception_get</methodname>
<void/>
</methodsynopsis>
<para>
直近の Java の例外を取得します。
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
例外オブジェクトを返します。
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
以下の例は、Java 例外ハンドラをPHPから使用する方法を示すものです。
<example>
<title>Java 例外ハンドラ</title>
<programlisting role="php">
<![CDATA[
<?php
$stack = new Java('java.util.Stack');
$stack->push(1);
// 以下のコードは実行に成功します
$result = $stack->pop();
$ex = java_last_exception_get();
if (!$ex) {
echo "$result\n";
}
// 以下のコードは失敗します (エラー出力は、@により抑制されています)
$result = @$stack->pop();
$ex = java_last_exception_get();
if ($ex) {
echo $ex->toString();
}
// 直近の例外をクリア
java_last_exception_clear();
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&warn.experimental.func;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->