|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.text.html.parser.Parser | +--javax.swing.text.html.parser.DocumentParser
HTML Documents ÀÇ Parser ÀÔ´Ï´Ù. ½ÇÁ¦·Î´Â DTD ¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù¸¸, swing ÀÇ html dtd ¿¡´Â ÀÌ Å¬·¡½º¸¸À» »ç¿ëÇϵµ·Ï ÇØ ÁÖ¼¼¿ä. HTML ÀÇ InputStream ¸¦ Àоîµé¿©, ParserCallback Ŭ·¡½ºÀÇ ÀûÀýÇÑ ¸Þ¼Òµå¸¦ È£ÃâÇÕ´Ï´Ù. ÀÌ Å¬·¡½º´Â HTMLEditorKit °¡ HTML url ¸¦ ±¸¹® ºÐ¼® Çϴµ¥ »ç¿ëÇÏ´Â µðÆúÆ®ÀÇ ÆÛ¼ÀÔ´Ï´Ù.
À¯È¿ÇÑ ¸ðµç ű×, ¹× ¾Ï½ÃµÇ°í ÀÖÁö¸¸ ¸í½ÃÀûÀ¸·Î´Â ÁöÁ¤µÇ¾î ÀÖÁö ¾ÊÀº ű׿¡ ´ëÇØ¼, ÄݹéÀ» ÀüÇÕ´Ï´Ù. ¿¹¸¦ µé¾î, HTML ij¸¯ÅÍ ¶óÀÎ (<p>blah)À¸·Î Á¤Àǵǰí ÀÖ´Â °ÍÀº p ÅÂ±× »ÓÀÔ´Ï´Ù. ÄݹéÀº ´ÙÀ½ÀÇ ¸Þ¼Òµå¸¦ °ËÃâÇÕ´Ï´Ù.
HTMLEditorKit.ParserCallback.IMPLIED
¿¡ Boolean.TRUE
ÀÇ °ªÀ» °¡Áý´Ï´Ù.
HTML.Attributes ´Â ÇüÅ ÇÁ·ÎÅØ¼ÇµÈ HTML ¼Ó¼ºÀÇ ¿°Å¸¦ Á¤ÀÇÇÕ´Ï´Ù. ű×ÀÇ ¼Ó¼º ۰¡ HTML.Attribute À¸·Î Á¤ÀǵǴ °æ¿ì´Â HTML.Attribute °¡ Ű·Î¼ »ç¿ëµÇ¾î ±×·¸Áö ¾ÊÀº °æ¿ì´Â String °¡ »ç¿ëµË´Ï´Ù. ¿¹¸¦ µé¾î <p foo=bar class=neat> ¿¡´Â 2 °³ÀÇ ¼Ó¼ºÀÌ ÀÖ½À´Ï´Ù. foo ´Â HTML.Attribute ¿¡¼´Â Á¤ÀǵÇÁö ¾Ê°í Ŭ·¡½º´Â HTML.Attribute ·Î Á¤Àǵ˴ϴÙ. µû¶ó¼ AttributeSet ´Â 2 °³ÀÇ °ªÀ» °¡Áý´Ï´Ù. neat ¶ó°í ÇÏ´Â String Ä¡¸¦ °¡Áö´Â HTML.Attribute.CLASS ¿Í bar ¶ó°í ÇÏ´Â String Ä¡¸¦ °¡Áö´Â String Ű foo ÀÔ´Ï´Ù.
À§Ä¡ Àμö´Â ű×, ÄÚ¸àÆ®, ¶Ç´Â ÅØ½ºÆ®ÀÇ °³½Ã¸¦ ³ªÅ¸³À´Ï´Ù. ¹è¿°ú °°°Ô, ½ºÆ®¸²ÀÇ ÃÖÃÊÀÇ Ä³¸¯ÅÍ´Â 0 À̶ó°í ÇÏ´Â À§Ä¡¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. ¾Ï½ÃµÇ´Â ű×ÀÇ °æ¿ì, À§Ä¡´Â ´ÙÀ½¿¡ °ËÃâµÇ´Â ű×ÀÇ À§Ä¡¸¦ ³ªÅ¸³À´Ï´Ù. ÃÖÃÊÀÇ ¿¹¿¡¼´Â ¾Ï½ÃµÈ º»Ã¼ °³½Ã ÅÂ±× ¹× HTML ű״ p ÅÂ±×¿Í °°Àº À§Ä¡¸¦ °¡Á®, ¾Ï½ÃµÈ ¸¶Áö¸· p ű×, HTML ÅÂ±× ¹× º»Ã¼ ű״ ¸ðµÎ °°Àº À§Ä¡¸¦ °¡Áö°í ÀÖ½À´Ï´Ù.
HTML ´Â °ø¹éÀ» ½ºÅµ Çϱâ À§ÇÑ(ÇØ), ÅØ½ºÆ®ÀÇ À§Ä¡´Â ÃÖÃÊÀÇ À¯È¿ÇÑ Ä³¸¯ÅÍÀÇ À§Ä¡°¡ µË´Ï´Ù. ¿¹¸¦ µé¾î ij¸¯ÅÍ ¶óÀÎ \n\n\nblah ¿¡¼´Â ÅØ½ºÆ® blah ´Â 3 À̶ó°í ÇÏ´Â À§Ä¡¸¦ °¡Á®, °³ÇàÀº ½ºÅµ µË´Ï´Ù.
°ªÀ» °¡ÁöÁö ¾Ê´Â ¼Ó¼º, ¿¹¸¦ µé¾î HTML ij¸¯ÅÍ ¶óÀÎ <foo blah>
ÀÇ ¼Ó¼º blah
´Â °ªÀ» °¡ÁöÁö ¾Ê½À´Ï´Ù¸¸, ÀÌ·¯ÇÑ ¼Ó¼ºÀÇ °æ¿ì´Â AttributeSet ÀÇ °ª¿¡ ¹èÄ¡µÇ´Â °ªÀ¸·Î ÇØ¼ ´ÙÀ½ÀÇ 2 °³°¡ »ý°¢µË´Ï´Ù.
HTML.NULL_ATTRIBUTE_VALUE
<! ATTLIST OPTION selected (selected) #IMPLIED>
ÀÇ °æ¿ì´Â selected
½ºÆ®¸²ÀÇ ÇØ¼®ÀÌ Á¾·áÇϸé(ÀÚ), ÄݹéÀº ÁÙ ³¡ ij¸¯ÅÍ ¶óÀÎÀÏ °¡´É¼ºÀÌ ³ôÀº ij¸¯ÅÍ ¶óÀÎÀÇ ÅëÁö¸¦ ¹Þ½À´Ï´Ù. ÁÙ ³¡ ij¸¯ÅÍ ¶óÀÎÀº ½ºÆ®¸²ÀÇ ÇØ¼®Áß¿¡ °¡Àå ¸¹ÀÌ °ËÃâµÇ´Â \n, \r ¶Ç´Â \r\n ÀÇ ¾î¶² °ÍÀΰ¡ÀÔ´Ï´Ù.
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º javax.swing.text.html.parser. Parser ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
dtd , strict |
ÀÎÅÍÆäÀ̽º javax.swing.text.html.parser. DTDConstants ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
ANY , CDATA , CONREF , CURRENT , DEFAULT , EMPTY , ENDTAG , ENTITIES , ENTITY , FIXED , GENERAL , ID , IDREF , IDREFS , IMPLIED , MD , MODEL , MS , NAME , NAMES , NMTOKEN , NMTOKENS , NOTATION , NUMBER , NUMBERS , NUTOKEN , NUTOKENS , PARAMETER , PI , PUBLIC , RCDATA , REQUIRED , SDATA , STARTTAG , SYSTEM |
»ý¼ºÀÚÀÇ °³¿ä | |
DocumentParser (DTD dtd)
|
¸Þ¼ÒµåÀÇ °³¿ä | |
protected void |
handleComment (char[] text)
HTML ÀÇ ÄÚ¸àÆ®¸¦ °ËÃâÇßÀ» ¶§¿¡ ºÒ·Á °©´Ï´Ù. |
protected void |
handleEmptyTag (TagElement tag)
ÇÏ´ÃÀÇ Å±׸¦ Ãë±ÞÇÕ´Ï´Ù. |
protected void |
handleEndTag (TagElement tag)
Á¾·á ű׸¦ Ãë±ÞÇÕ´Ï´Ù. |
protected void |
handleError (int ln,
String errorMsg)
¿¡·¯°¡ ¹ß»ýÇÑ °ÍÀ» ³ªÅ¸³À´Ï´Ù. |
protected void |
handleStartTag (TagElement tag)
°³½Ã ű׸¦ Ãë±ÞÇÕ´Ï´Ù. |
protected void |
handleText (char[] data)
ÅØ½ºÆ®¸¦ Ãë±ÞÇÕ´Ï´Ù. |
void |
parse (Reader in,
HTMLEditorKit.ParserCallback callback,
boolean ignoreCharSet)
|
Ŭ·¡½º javax.swing.text.html.parser. Parser ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
endTag , error , error , error , error , flushAttributes , getAttributes , getCurrentLine , getCurrentPos , handleEOFInComment , handleTitle , makeTag , makeTag , markFirstTime , parse , parseDTDMarkup , parseMarkupDeclarations , startTag |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public DocumentParser(DTD dtd)
¸Þ¼ÒµåÀÇ »ó¼¼ |
public void parse(Reader in, HTMLEditorKit.ParserCallback callback, boolean ignoreCharSet) throws IOException
IOException
protected void handleStartTag(TagElement tag)
Parser
³»ÀÇ handleStartTag
protected void handleComment(char[] text)
Parser
ÀÇ ±â¼ú:
Parser
³»ÀÇ handleComment
protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException
Parser
³»ÀÇ handleEmptyTag
ChangedCharSetException
protected void handleEndTag(TagElement tag)
Parser
³»ÀÇ handleEndTag
protected void handleText(char[] data)
Parser
³»ÀÇ handleText
protected void handleError(int ln, String errorMsg)
Parser
ÀÇ ±â¼ú:
Parser
³»ÀÇ handleError
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.