JavaTM 2 Platform
Standard Ed. 5.0

javax.xml.xpath
Ŭ·¡½º XPathException

java.lang.Object 
  »óÀ§¸¦ È®Àå java.lang.Throwable 
      »óÀ§¸¦ È®Àå java.lang.Exception 
          »óÀ§¸¦ È®Àå javax.xml.xpath.XPathException
¸ðµç ±¸ÇöµÈ ÀÎÅÍÆäÀ̽º:
Serializable
¾Ë·ÁÁø Á÷°è ¼­ºê Ŭ·¡½º:
XPathExpressionException, XPathFactoryConfigurationException

public class XPathException
extends Exception

XPathException´Â ¹ü¿ë XPath ¿¹¿Ü¸¦ ³ªÅ¸³À´Ï´Ù.

µµÀÔµÈ ¹öÀü :
1.5
°ü·Ã Ç׸ñ:
Á÷·ÄÈ­ µÈ Çü½Ä

»ý¼ºÀÚ °³¿ä
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
 

»ý¼ºÀÚ »ó¼¼

XPathException

public XPathException(String  message)

ÁöÁ¤µÈ »ó¼¼ ¸Þ¼¼Áö·Î »õ·Î¿î XPathExceptionÀ» ±¸ÃàÇÕ´Ï´Ù.

cause´Â ÃʱâÈ­µÇÁö ¾Ê½À´Ï´Ù.

message°¡ nullÀÎ °æ¿ì´Â NullPointerException°¡ ¹ß»ý µË´Ï´Ù.

ÆĶó¹ÌÅÍ:
message - »ó¼¼ ¸Þ¼¼Áö

XPathException

public XPathException(Throwable  cause)

ÁöÁ¤µÈ cause·Î »õ·Î¿î XPathExceptionÀ» ±¸ÃàÇÕ´Ï´Ù.

cause°¡ nullÀÎ °æ¿ì´Â NullPointerException°¡ ¹ß»ý µË´Ï´Ù.

ÆĶó¹ÌÅÍ:
cause - ¿øÀÎ
¿¹¿Ü:
NullPointerException - cause°¡ nullÀÎ °æ¿ì
¸Þ¼­µåÀÇ »ó¼¼

getCause

public Throwable  getCause()
Ŭ·¡½º Throwable ±â¼ú:
¿øÀÎÀÌ Á¸ÀçÇÏÁö ¾Ê´Â°¡ ºÒ¸íÇÑ °æ¿ì¿¡ ÀÌ Throwable ¶Ç´Â null ¿øÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. ¿øÀÎÀº ÀÌ Throwable¸¦ Throw ½ÃŲ Throwable ÀÔ´Ï´Ù.

ÀÌ ±¸ÇöÀº, Throwable¸¦ ¿ä±¸ÇÏ´Â ¸î°³ÀÇ »ý¼ºÀÚ °æÀ¯·Î Á¦°øµÈ ¿øÀÎ, ¶Ç´Â Throwable.initCause(Throwable) ¸Þ¼­µå¸¦ »ç¿ëÇØ ÀÛ¼º ÈÄ·Î ¼³Á¤µÈ ¿øÀÎÀ» ¸®ÅÏÇÕ´Ï´Ù. º¸Åë, ÀÌ ¸Þ¼­µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù¸¸, ¼­ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼­µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ´Ù¸¥ ¾î¶°ÇÑ ¹æ¹ýÀ¸·Î ¼³Á¤µÈ ¿øÀÎÀ» µ¹·ÁÁÙ ¼ö°¡ ÀÖ½À´Ï´Ù. ÀÌ°ÍÀº üÀÎ µÈ ¿¹¿ÜÀÇ Throwable¿¡ ÀÇ Ãß°¡Àü¿¡ ½ÇÇàµÇ´Â ¡¸À¯»ê ¿¬¼â Throw °¡´É °´Ã¼¡¹ÀÇ °æ¿ì¿¡ ÀûÀýÇÑ µ¿ÀÛÀÔ´Ï´Ù. PrintStackTrace ¸Þ¼­µåÀÇ ¾î´ÀÂÊÀ̵çÀ» ¿À¹ö¶óÀ̵å(override) ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼­µå´Â ¸ðµÎ getCause ¸Þ¼­µå¸¦ È£ÃâÇØ, Throw °¡´É °´Ã¼ÀÇ ¿øÀÎÀ» ÆǺ°ÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Throwable ³»ÀÇ getCause
¹Ýȯ°ª:
Throw °¡´ÉÇÑ °´Ã¼ÀÇ ¿øÀÎ. ¿øÀÎÀÌ Á¸ÀçÇÏÁö ¾Ê´Â°¡ ºÒ¸íÀÇ °æ¿ì´Â null

printStackTrace

public void printStackTrace(PrintStream  s)
Ŭ·¡½º Throwable ±â¼ú:
ÀÌ Throw °¡´É °´Ã¼¿Í ±× ¹é Æ®·¹À̽º°¡ ÁöÁ¤µÈ Àμ⠽ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Throwable ³»ÀÇ printStackTrace
ÆĶó¹ÌÅÍ:
s - Ãâ·Â¿¡ »ç¿ëÇÏ´Â PrintStream

printStackTrace

public void printStackTrace()
Ŭ·¡½º Throwable ±â¼ú:
ÀÌ Throw °¡´É °´Ã¼ ¹× ±× ¹é Æ®·¹À̽º¸¦ Ç¥ÁØ ¿¡·¯ ½ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù. ÀÌ ¸Þ¼­µå´Â ÀÌ 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 {
 }
 

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Throwable ³»ÀÇ printStackTrace

printStackTrace

public void printStackTrace(PrintWriter  s)
Ŭ·¡½º Throwable ±â¼ú:
ÀÌ Throw °¡´É °´Ã¼¿Í ±× ¹é Æ®·¹À̽º°¡ ÁöÁ¤µÈ ÇÁ¸°Æ® Writer¿¡ Ãâ·ÂÇÕ´Ï´Ù.

¿À¹ö¶óÀ̵å(override):
Ŭ·¡½º Throwable ³»ÀÇ printStackTrace
ÆĶó¹ÌÅÍ:
s - Ãâ·Â¿¡ »ç¿ëÇÏ´Â PrintWriter

JavaTM 2 Platform
Standard Ed. 5.0

Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.