|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.html.parser.Parser
public class Parser
DTD 구동형의 단순한 HTML 퍼서입니다. 퍼서는 InputStream 로부터 HTML 파일을 읽어내, 태그나 데이터를 검출하면(자), 각종의 메소드 (서브 클래스에서 오버라이드(override) 된다)를 호출합니다.
유감스럽게, 올바르게 구현되어 있지 않은 HTML 퍼서가 많이 나돌고 있습니다. 그 결과, 서식의 올바르지 않은 HTML 파일도 다수 존재합니다. 이 퍼서는, 대부분의 HTML 파일의 해석을 시도합니다. 즉, 이 구현은 HTML 를 우선해, SGML 의 스펙과는 다른 경우도 있습니다.
이 퍼서는, \r 및 \r\n 를 \n 로서 취급합니다. 개시 태그의 뒤, 및 종료 태그의 전의 개행은, SGML 나 HTML 의 스펙에 따라 무시됩니다.
HTML 스펙에서는, 공백 문자가 어떻게 연속할까에 임해서 명확하게 지정되고 있지 않습니다. 특히, 다음과 같은 시나리오에 대해서는 논의되고 있지 않습니다 (여기에서는 공백 문자를 사용해야 하지만, 공백 문자의 표시에   를 사용하고 있다).
' 「<b>blah <i> <strike> foo」는 「<b>blah <i><strike>foo」와 같은 것으로서 다루어집니다.
같이 「<p><a href="xx"> <em>Using</em></a></p>」는 「<p><a href="xx"><em>Using</em></a></p>」와 같은 것으로서 다루어집니다.
strict
가 false 의 경우, 플로우를 브레이크하는 태그 (TagElement.breaksFlows
)나 말미에 공백이 발견되면(자), 공백 이외의 문자가 발견될 때까지, 공백은 모두 무시됩니다. 이것에 의해, 일반적인 브라우저에 동작이 가까운 시일내에 됩니다.
DTD
,
TagElement
,
SimpleAttributeSet
필드의 개요 | |
---|---|
protected DTD |
dtd
|
protected boolean |
strict
이 플래그는, Parser 가 SGML 와의 호환성을 엄밀하게 조사할지 어떨지를 결정합니다. |
인터페이스 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 |
생성자 의 개요 | |
---|---|
Parser (DTD dtd)
|
메소드의 개요 | |
---|---|
protected void |
endTag (boolean omitted)
종료 태그를 처리합니다. |
protected void |
error (String err)
|
protected void |
error (String err,
String arg1)
|
protected void |
error (String err,
String arg1,
String arg2)
|
protected void |
error (String err,
String arg1,
String arg2,
String arg3)
에러 핸들러를 호출합니다. |
protected void |
flushAttributes ()
|
protected SimpleAttributeSet |
getAttributes ()
|
protected int |
getCurrentLine ()
|
protected int |
getCurrentPos ()
|
protected void |
handleComment (char[] text)
HTML 의 코멘트를 검출했을 때에 불려 갑니다. |
protected void |
handleEmptyTag (TagElement tag)
빈 상태(empty)의 태그를 검출했을 때에 불려 갑니다. |
protected void |
handleEndTag (TagElement tag)
종료 태그를 검출했을 때에 불려 갑니다. |
protected void |
handleEOFInComment ()
|
protected void |
handleError (int ln,
String msg)
에러가 발생한 것을 나타냅니다. |
protected void |
handleStartTag (TagElement tag)
개시 태그를 검출했을 때에 불려 갑니다. |
protected void |
handleText (char[] text)
PCDATA 를 검출했을 때에 불려 갑니다. |
protected void |
handleTitle (char[] text)
HTML 의 title 태그를 검출했을 때에 불려 갑니다. |
protected TagElement |
makeTag (Element elem)
|
protected TagElement |
makeTag (Element elem,
boolean fictional)
TagElement 을 작성합니다. |
protected void |
markFirstTime (Element elem)
문서내에서 최초로 발견된 태그에 마크를 붙입니다. |
void |
parse (Reader in)
DTD 가 지정되고 있는 경우에, HTML 스트림을 해석합니다. |
String |
parseDTDMarkup ()
문서형 정의 (DTD - Document Type Declaration)의 마크 업 선언을 해석합니다. |
protected boolean |
parseMarkupDeclarations (StringBuffer strBuff)
마크 업 선언을 해석합니다. |
protected void |
startTag (TagElement tag)
개시 태그를 처리합니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
필드의 상세 |
---|
protected DTD dtd
protected boolean strict
생성자 의 상세 |
---|
public Parser(DTD dtd)
메소드의 상세 |
---|
protected int getCurrentLine()
protected TagElement makeTag(Element elem, boolean fictional)
protected TagElement makeTag(Element elem)
protected SimpleAttributeSet getAttributes()
protected void flushAttributes()
protected void handleText(char[] text)
protected void handleTitle(char[] text)
protected void handleComment(char[] text)
protected void handleEOFInComment()
protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException
ChangedCharSetException
protected void handleStartTag(TagElement tag)
protected void handleEndTag(TagElement tag)
protected void handleError(int ln, String msg)
protected void error(String err, String arg1, String arg2, String arg3)
protected void error(String err, String arg1, String arg2)
protected void error(String err, String arg1)
protected void error(String err)
protected void startTag(TagElement tag) throws ChangedCharSetException
ChangedCharSetException
protected void endTag(boolean omitted)
protected void markFirstTime(Element elem)
public String parseDTDMarkup() throws IOException
IOException
protected boolean parseMarkupDeclarations(StringBuffer strBuff) throws IOException
IOException
public void parse(Reader in) throws IOException
IOException
protected int getCurrentPos()
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.