|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Object java.lang.Throwable java.lang.Exception javax.xml.xpath.XPathException
public class XPathException
XPathException
´Â ¹ü¿ë XPath ¿¹¿Ü¸¦ ³ªÅ¸³À´Ï´Ù.
»ý¼ºÀÚ °³¿ä | |
---|---|
XPathException (String message)
ÁöÁ¤µÈ »ó¼¼ ¸Þ¼¼Áö·Î »õ·Î¿î XPathException À»
±¸ÃàÇÕ´Ï´Ù. |
|
XPathException (Throwable cause)
ÁöÁ¤µÈ cause ·Î
»õ·Î¿î XPathException À»
±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
Throwable |
getCause ()
¿øÀÎÀÌ Á¸ÀçÇÏÁö ¾Ê´Â°¡ ºÒ¸íÇÑ °æ¿ì¿¡ ÀÌ Throwable ¶Ç´Â null
¿øÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. |
void |
printStackTrace ()
ÀÌ Throw °¡´É °´Ã¼ ¹× ±× ¹é Æ®·¹À̽º¸¦ Ç¥ÁØ ¿¡·¯ ½ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
void |
printStackTrace (PrintStream s)
ÀÌ Throw °¡´É °´Ã¼¿Í ±× ¹é Æ®·¹À̽º°¡ ÁöÁ¤µÈ Àμ⠽ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
void |
printStackTrace (PrintWriter s)
ÀÌ Throw °¡´É °´Ã¼¿Í ±× ¹é Æ®·¹À̽º°¡ ÁöÁ¤µÈ ÇÁ¸°Æ® Writer¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Throwable ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
fillInStackTrace,
getLocalizedMessage,
getMessage,
getStackTrace,
initCause,
setStackTrace,
toString |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public XPathException(String message)
ÁöÁ¤µÈ »ó¼¼ ¸Þ¼¼Áö·Î »õ·Î¿î XPathException
À»
±¸ÃàÇÕ´Ï´Ù.
cause
´Â ÃʱâȵÇÁö ¾Ê½À´Ï´Ù.
message
°¡ null
ÀÎ °æ¿ì´Â NullPointerException
°¡ ¹ß»ý µË´Ï´Ù.
message
- »ó¼¼ ¸Þ¼¼Áöpublic XPathException(Throwable cause)
ÁöÁ¤µÈ cause
·Î
»õ·Î¿î XPathException
À»
±¸ÃàÇÕ´Ï´Ù.
cause
°¡ null
ÀÎ °æ¿ì´Â NullPointerException
°¡ ¹ß»ý µË´Ï´Ù.
cause
- ¿øÀÎ
NullPointerException
- cause
°¡ null
ÀÎ °æ¿ì¸Þ¼µåÀÇ »ó¼¼ |
---|
public Throwable getCause()
Throwable
񃬣: null
¿øÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. ¿øÀÎÀº ÀÌ Throwable¸¦ Throw ½ÃŲ Throwable ÀÔ´Ï´Ù.
ÀÌ ±¸ÇöÀº, Throwable¸¦ ¿ä±¸ÇÏ´Â ¸î°³ÀÇ »ý¼ºÀÚ
°æÀ¯·Î Á¦°øµÈ ¿øÀÎ, ¶Ç´Â Throwable.initCause(Throwable)
¸Þ¼µå¸¦ »ç¿ëÇØ ÀÛ¼º ÈÄ·Î ¼³Á¤µÈ ¿øÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. º¸Åë, ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù¸¸, ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ´Ù¸¥ ¾î¶°ÇÑ ¹æ¹ýÀ¸·Î ¼³Á¤µÈ ¿øÀÎÀ» µ¹·ÁÁÙ ¼ö°¡ ÀÖ½À´Ï´Ù. ÀÌ°ÍÀº üÀÎ µÈ ¿¹¿ÜÀÇ Throwable¿¡
ÀÇ Ãß°¡Àü¿¡ ½ÇÇàµÇ´Â ¡¸À¯»ê ¿¬¼â Throw °¡´É °´Ã¼¡¹ÀÇ °æ¿ì¿¡ ÀûÀýÇÑ µ¿ÀÛÀÔ´Ï´Ù. PrintStackTrace ¸Þ¼µåÀÇ ¾î´ÀÂÊÀ̵çÀ» ¿À¹ö¶óÀ̵å(override) ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼µå´Â ¸ðµÎ getCause ¸Þ¼µå¸¦ È£ÃâÇØ, Throw °¡´É °´Ã¼ÀÇ ¿øÀÎÀ» ÆǺ°ÇÕ´Ï´Ù.
Throwable
³»ÀÇ getCause
null
public void printStackTrace(PrintStream s)
Throwable
񃬣:
Throwable
³»ÀÇ printStackTrace
s
- Ãâ·Â¿¡ »ç¿ëÇÏ´Â PrintStream
public void printStackTrace()
Throwable
񃬣: System.err
ÇʵåÀÇ °ªÀÎ ¿¡·¯ Ãâ·Â ½ºÆ®¸²·Î Ãâ·ÂÇÕ´Ï´Ù. Ãâ·ÂÀÇ ¼±µÎÇà¿¡´Â ÀÌ °´Ã¼¿¡ ´ëÇÑ Throwable.toString()
¸Þ¼µåÀÇ °á°ú°¡ Æ÷ÇԵ˴ϴÙ. ³ª¸ÓÁöÀÇ ÇàÀº ÀÌÀü¿¡ Throwable.fillInStackTrace()
¸Þ¼µå¿¡ ÀÇÇØ ±â·ÏµÈ µ¥ÀÌÅ͸¦ ³ªÅ¸³À´Ï´Ù. ÀÌ Á¤º¸ÀÇ ¼½ÄÀº ±¸Çö¿¡ ÀÇÇØ ´Ù¼Ò ´Ù¸¨´Ï´Ù¸¸, ÀüÇüÀûÀÎ ¼½ÄÀÇ ¿¹¸¦ ´ÙÀ½¿¡ ³ªÅ¸³À´Ï´Ù. ÀÌ ¿¹´Â ´ÙÀ½ÀÇ ÇÁ·Î±×·¥À» ½ÇÇàÇÏ´Â °Í¿¡ ÀÇÇØ ÀÛ¼ºµÈ °ÍÀÔ´Ï´Ù.java.lang.NullPointerException at MyClass.mash(MyClass.java:9) at MyClass.crunch(MyClass.java:6) at MyClass.main(MyClass.java:3)
class MyClass { public static void main (String [] args) { crunch(null); } static void crunch(int[] a) { mash(a); } static void mash(int[] b) { System.out.println(b[0]); } }ÃʱâÈµÈ ºñ null ¿øÀÎÀ» º¸°ü À¯ÁöÇÏ´Â Throw °¡´É °´Ã¼ÀÇ ¹é Æ®·¹À̽º¿¡´Â º¸Åë, ¿øÀÎÀÇ ¹é Æ®·¹À̽º°¡ Æ÷ÇԵ˴ϴÙ. ÀÌ Á¤º¸ÀÇ ¼½ÄÀº ±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù¸¸, ÀüÇüÀûÀÎ ¼½ÄÀÇ ¿¹¸¦ ´ÙÀ½¿¡ ³ªÅ¸³À´Ï´Ù.
HighLevelException: MidLevelException: LowLevelException at Junk.a(Junk.java:13) at Junk.main(Junk.java:4) Caused by: MidLevelException: LowLevelException at Junk.c(Junk.java:23) at Junk.b(Junk.java:17) at Junk.a(Junk.java:11) ... 1 more Caused by: LowLevelException at Junk.e(Junk.java:30) at Junk.d(Junk.java:27) at Junk.c(Junk.java:21) ... 3 more¹®ÀÚ "..."¸¦ Æ÷ÇÔÇÑ ÇàÀÌ Á¸ÀçÇÏ´Â °Í¿¡ ÁÖ¸ñÇØ ÁÖ¼¼¿ä. ÀÌ·¯ÇÑ ÇàÀº ÀÌ ¿¹¿ÜÀÇ ½ºÅà Ʈ·¹À̽ºÀÇ ³ª¸ÓÁö°¡ ÀÌ ¿¹¿Ü¿¡ ÀÇÇØ ÀÏÀ¸ÄÑÁø ¿¹¿ÜÀÇ ½ºÅà Ʈ·¹À̽º¾Æ·¡·ÎºÎÅÍÀÇ ÇÁ·¹ÀÓ¼ö·Î ÀÏÄ¡ÇÏ´Â °ÍÀ» ³ªÅ¸³À´Ï´Ù. º¸Åë ÀÇ ( ¡¸¿øÀÎÀÌ µÇ´Â ¿¹¿Ü¡¹¸¦ ijġ ÇÏ´Â °Í°ú °°Àº ¸Þ¼µå·ÎºÎÅÍ ·¦ µÈ ¿¹¿Ü°¡ Throw µÈ´Ù) °æ¿ì, ÀÌ ´ÜÃàÇüÀ» »ç¿ëÇÏ´Â °ÍÀ¸·Î Ãâ·ÂÀÇ ±æÀ̸¦ Å«ÆøÀ¸·Î ´ÜÃàÇÒ ¼ö ÀÖ½À´Ï´Ù. À§ÀÇ ¿¹´Â ´ÙÀ½ÀÇ ÇÁ·Î±×·¥À» ½ÇÇàÇÏ´Â °ÍÀ¸·Î »ý¼ºµË´Ï´Ù.
public class Junk { public static void main(String args[]) { try { a(); } catch(HighLevelException e) { e.printStackTrace(); } } static void a() throws HighLevelException { try { b(); } catch(MidLevelException e) { throw new HighLevelException(e); } } static void b() throws MidLevelException { c(); } static void c() throws MidLevelException { try { d(); } catch(LowLevelException e) { throw new MidLevelException(e); } } static void d() throws LowLevelException { e(); } static void e() throws LowLevelException { throw new LowLevelException(); } } class HighLevelException extends Exception { HighLevelException(Throwable cause) { super(cause); } } class MidLevelException extends Exception { MidLevelException(Throwable cause) { super(cause); } } class LowLevelException extends Exception { }
Throwable
³»ÀÇ printStackTrace
public void printStackTrace(PrintWriter s)
Throwable
񃬣:
Throwable
³»ÀÇ printStackTrace
s
- Ãâ·Â¿¡ »ç¿ëÇÏ´Â PrintWriter
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.