|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nu.validator.htmlparser.impl.Tokenizer
public class Tokenizer
An implementation of
http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html
This class implements the Locator
interface. This is not an
incidental implementation detail: Users of this class are encouraged to make
use of the Locator
nature.
By default, the tokenizer may report data that XML 1.0 bans. The tokenizer
can be configured to treat these conditions as fatal or to coerce the infoset
to something that XML 1.0 allows.
Constructor Summary | |
---|---|
Tokenizer(TokenHandler tokenHandler)
The constructor. |
|
Tokenizer(TokenHandler tokenHandler,
boolean newAttributesEachTime)
|
Method Summary | |
---|---|
void |
becomeConfident()
|
protected char |
checkChar(char[] buf,
int pos)
|
void |
end()
|
void |
eof()
|
void |
err(java.lang.String message)
Reports a Parse Error. |
protected void |
errAstralNonCharacter(int ch)
|
protected void |
errAttributeValueMissing()
|
protected void |
errBadCharAfterLt(char c)
|
protected void |
errBadCharBeforeAttributeNameOrNull(char c)
|
protected void |
errBogusComment()
|
protected void |
errBogusDoctype()
|
protected void |
errCharRefLacksSemicolon()
|
protected void |
errConsecutiveHyphens()
|
protected void |
errDuplicateAttribute()
|
protected void |
errEofAfterLt()
|
protected void |
errEofInAttributeName()
|
protected void |
errEofInAttributeValue()
|
protected void |
errEofInComment()
|
protected void |
errEofInDoctype()
|
protected void |
errEofInEndTag()
|
protected void |
errEofInPublicId()
|
protected void |
errEofInSystemId()
|
protected void |
errEofInTagName()
|
protected void |
errEofWithoutGt()
|
protected void |
errEqualsSignBeforeAttributeName()
|
protected void |
errExpectedPublicId()
|
protected void |
errExpectedSystemId()
|
protected void |
errGarbageAfterLtSlash()
|
protected void |
errGtInPublicId()
|
protected void |
errGtInSystemId()
|
protected void |
errHtml4LtSlashInRcdata(char folded)
|
protected void |
errHtml4NonNameInUnquotedAttribute(char c)
|
protected void |
errHtml4XmlVoidSyntax()
|
protected void |
errHyphenHyphenBang()
|
protected void |
errLtGt()
|
protected void |
errLtOrEqualsOrGraveInUnquotedAttributeOrNull(char c)
|
protected void |
errLtSlashGt()
|
protected void |
errMissingSpaceBeforeDoctypeName()
|
protected void |
errNamelessDoctype()
|
protected void |
errNcrControlChar()
|
protected char |
errNcrControlChar(char ch)
|
protected void |
errNcrCr()
|
protected void |
errNcrInC1Range()
|
protected char |
errNcrNonCharacter(char ch)
|
protected void |
errNcrOutOfRange()
|
protected void |
errNcrSurrogate()
|
protected void |
errNcrUnassigned()
|
protected void |
errNcrZero()
|
protected void |
errNoDigitsInNCR()
|
protected void |
errNoNamedCharacterMatch()
|
protected void |
errNoSpaceBetweenAttributes()
|
protected void |
errNoSpaceBetweenDoctypePublicKeywordAndQuote()
|
protected void |
errNoSpaceBetweenDoctypeSystemKeywordAndQuote()
|
protected void |
errNoSpaceBetweenPublicAndSystemIds()
|
protected void |
errNotSemicolonTerminated()
|
protected void |
errPrematureEndOfComment()
|
protected void |
errProcessingInstruction()
|
protected void |
errQuoteBeforeAttributeName(char c)
|
protected void |
errQuoteOrLtInAttributeNameOrNull(char c)
|
protected void |
errSlashNotFollowedByGt()
|
void |
errTreeBuilder(java.lang.String message)
|
protected void |
errUnescapedAmpersandInterpretedAsCharacterReference()
|
protected void |
errUnquotedAttributeValOrNull(char c)
|
protected void |
errWarnLtSlashInRcdata()
|
void |
fatal(java.lang.String message)
Reports an condition that would make the infoset incompatible with XML 1.0 as fatal. |
protected void |
flushChars(char[] buf,
int pos)
Flushes coalesced character tokens. |
int |
getCol()
Returns the col. |
int |
getColumnNumber()
|
org.xml.sax.ErrorHandler |
getErrorHandler()
|
int |
getLine()
Returns the line. |
int |
getLineNumber()
|
java.lang.String |
getPublicId()
|
java.lang.String |
getSystemId()
|
void |
initializeWithoutStarting()
|
void |
initLocation(java.lang.String newPublicId,
java.lang.String newSystemId)
|
boolean |
internalEncodingDeclaration(java.lang.String internalCharset)
|
boolean |
isAlreadyComplainedAboutNonAscii()
Returns the alreadyComplainedAboutNonAscii. |
boolean |
isInDataState()
|
boolean |
isMappingLangToXmlLang()
Returns the mappingLangToXmlLang. |
boolean |
isNextCharOnNewLine()
Returns the nextCharOnNewLine. |
boolean |
isPrevCR()
|
void |
loadState(Tokenizer other)
|
protected void |
maybeErrAttributesOnEndTag(HtmlAttributes attrs)
|
protected void |
maybeErrSlashInEndTag(boolean selfClosing)
|
protected void |
maybeWarnPrivateUse(char ch)
|
protected void |
maybeWarnPrivateUseAstral()
|
protected void |
noteAttributeWithoutValue()
|
protected void |
noteUnquotedAttributeValue()
|
void |
notifyAboutMetaBoundary()
|
void |
requestSuspension()
|
void |
resetToDataState()
|
void |
setCommentPolicy(XmlViolationPolicy commentPolicy)
Sets the commentPolicy. |
void |
setContentNonXmlCharPolicy(XmlViolationPolicy contentNonXmlCharPolicy)
Sets the contentNonXmlCharPolicy. |
void |
setContentSpacePolicy(XmlViolationPolicy contentSpacePolicy)
Sets the contentSpacePolicy. |
void |
setEncodingDeclarationHandler(EncodingDeclarationHandler encodingDeclarationHandler)
Sets the encodingDeclarationHandler. |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Sets the error handler. |
void |
setHtml4ModeCompatibleWithXhtml1Schemata(boolean html4ModeCompatibleWithXhtml1Schemata)
Sets the html4ModeCompatibleWithXhtml1Schemata. |
void |
setInterner(Interner interner)
|
void |
setLineNumber(int line)
For C++ use only. |
void |
setMappingLangToXmlLang(boolean mappingLangToXmlLang)
Sets the mappingLangToXmlLang. |
void |
setNamePolicy(XmlViolationPolicy namePolicy)
|
void |
setStateAndEndTagExpectation(int specialTokenizerState,
ElementName endTagExpectation)
Sets the tokenizer state and the associated element name. |
void |
setStateAndEndTagExpectation(int specialTokenizerState,
java.lang.String endTagExpectation)
Sets the tokenizer state and the associated element name. |
void |
setTransitionBaseOffset(int offset)
Sets an offset to be added to the position reported to TransitionHandler . |
void |
setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy)
Sets the xmlnsPolicy. |
protected void |
silentCarriageReturn()
|
protected void |
silentLineFeed()
|
void |
start()
|
protected void |
startErrorReporting()
|
protected java.lang.String |
strBufToString()
The smaller buffer as a String. |
boolean |
tokenizeBuffer(UTF16Buffer buffer)
|
protected int |
transition(int from,
int to,
boolean reconsume,
int pos)
|
void |
warn(java.lang.String message)
Reports a warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DATA
public static final int RCDATA
public static final int SCRIPT_DATA
public static final int RAWTEXT
public static final int SCRIPT_DATA_ESCAPED
public static final int ATTRIBUTE_VALUE_DOUBLE_QUOTED
public static final int ATTRIBUTE_VALUE_SINGLE_QUOTED
public static final int ATTRIBUTE_VALUE_UNQUOTED
public static final int PLAINTEXT
public static final int TAG_OPEN
public static final int CLOSE_TAG_OPEN
public static final int TAG_NAME
public static final int BEFORE_ATTRIBUTE_NAME
public static final int ATTRIBUTE_NAME
public static final int AFTER_ATTRIBUTE_NAME
public static final int BEFORE_ATTRIBUTE_VALUE
public static final int AFTER_ATTRIBUTE_VALUE_QUOTED
public static final int BOGUS_COMMENT
public static final int MARKUP_DECLARATION_OPEN
public static final int DOCTYPE
public static final int BEFORE_DOCTYPE_NAME
public static final int DOCTYPE_NAME
public static final int AFTER_DOCTYPE_NAME
public static final int BEFORE_DOCTYPE_PUBLIC_IDENTIFIER
public static final int DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED
public static final int DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED
public static final int AFTER_DOCTYPE_PUBLIC_IDENTIFIER
public static final int BEFORE_DOCTYPE_SYSTEM_IDENTIFIER
public static final int DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED
public static final int DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED
public static final int AFTER_DOCTYPE_SYSTEM_IDENTIFIER
public static final int BOGUS_DOCTYPE
public static final int COMMENT_START
public static final int COMMENT_START_DASH
public static final int COMMENT
public static final int COMMENT_END_DASH
public static final int COMMENT_END
public static final int COMMENT_END_BANG
public static final int NON_DATA_END_TAG_NAME
public static final int MARKUP_DECLARATION_HYPHEN
public static final int MARKUP_DECLARATION_OCTYPE
public static final int DOCTYPE_UBLIC
public static final int DOCTYPE_YSTEM
public static final int AFTER_DOCTYPE_PUBLIC_KEYWORD
public static final int BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS
public static final int AFTER_DOCTYPE_SYSTEM_KEYWORD
public static final int CONSUME_CHARACTER_REFERENCE
public static final int CONSUME_NCR
public static final int CHARACTER_REFERENCE_TAIL
public static final int HEX_NCR_LOOP
public static final int DECIMAL_NRC_LOOP
public static final int HANDLE_NCR_VALUE
public static final int HANDLE_NCR_VALUE_RECONSUME
public static final int CHARACTER_REFERENCE_HILO_LOOKUP
public static final int SELF_CLOSING_START_TAG
public static final int CDATA_START
public static final int CDATA_SECTION
public static final int CDATA_RSQB
public static final int CDATA_RSQB_RSQB
public static final int SCRIPT_DATA_LESS_THAN_SIGN
public static final int SCRIPT_DATA_ESCAPE_START
public static final int SCRIPT_DATA_ESCAPE_START_DASH
public static final int SCRIPT_DATA_ESCAPED_DASH
public static final int SCRIPT_DATA_ESCAPED_DASH_DASH
public static final int BOGUS_COMMENT_HYPHEN
public static final int RAWTEXT_RCDATA_LESS_THAN_SIGN
public static final int SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN
public static final int SCRIPT_DATA_DOUBLE_ESCAPE_START
public static final int SCRIPT_DATA_DOUBLE_ESCAPED
public static final int SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN
public static final int SCRIPT_DATA_DOUBLE_ESCAPED_DASH
public static final int SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH
public static final int SCRIPT_DATA_DOUBLE_ESCAPE_END
protected final TokenHandler tokenHandler
protected EncodingDeclarationHandler encodingDeclarationHandler
protected org.xml.sax.ErrorHandler errorHandler
protected boolean lastCR
protected int stateSave
protected int index
protected int value
protected int cstart
protected ElementName endTagExpectation
protected boolean endTag
true
if tokenizing an end tag
protected AttributeName attributeName
protected boolean html4
true
when HTML4-specific additional errors are requested.
protected boolean confident
protected LocatorImpl ampersandLocation
Constructor Detail |
---|
public Tokenizer(TokenHandler tokenHandler, boolean newAttributesEachTime)
public Tokenizer(TokenHandler tokenHandler)
tokenHandler
- the handler for receiving tokensMethod Detail |
---|
public void setInterner(Interner interner)
public void initLocation(java.lang.String newPublicId, java.lang.String newSystemId)
public boolean isMappingLangToXmlLang()
public void setMappingLangToXmlLang(boolean mappingLangToXmlLang)
mappingLangToXmlLang
- the mappingLangToXmlLang to setpublic void setErrorHandler(org.xml.sax.ErrorHandler eh)
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
public org.xml.sax.ErrorHandler getErrorHandler()
public void setCommentPolicy(XmlViolationPolicy commentPolicy)
commentPolicy
- the commentPolicy to setpublic void setContentNonXmlCharPolicy(XmlViolationPolicy contentNonXmlCharPolicy)
contentNonXmlCharPolicy
- the contentNonXmlCharPolicy to setpublic void setContentSpacePolicy(XmlViolationPolicy contentSpacePolicy)
contentSpacePolicy
- the contentSpacePolicy to setpublic void setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy)
xmlnsPolicy
- the xmlnsPolicy to setpublic void setNamePolicy(XmlViolationPolicy namePolicy)
public void setHtml4ModeCompatibleWithXhtml1Schemata(boolean html4ModeCompatibleWithXhtml1Schemata)
html4ModeCompatibleWithXhtml1Schemata
- the html4ModeCompatibleWithXhtml1Schemata to setpublic void setStateAndEndTagExpectation(int specialTokenizerState, java.lang.String endTagExpectation)
specialTokenizerState
- the tokenizer state to setendTagExpectation
- the expected end tag for transitioning back to normalpublic void setStateAndEndTagExpectation(int specialTokenizerState, ElementName endTagExpectation)
specialTokenizerState
- the tokenizer state to setendTagExpectation
- the expected end tag for transitioning back to normalpublic void setLineNumber(int line)
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
Locator.getLineNumber()
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
Locator.getColumnNumber()
public java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
Locator.getPublicId()
public java.lang.String getSystemId()
getSystemId
in interface org.xml.sax.Locator
Locator.getSystemId()
public void notifyAboutMetaBoundary()
protected java.lang.String strBufToString()
C++ memory note: The return value must be released.
protected void flushChars(char[] buf, int pos) throws org.xml.sax.SAXException
buf
- TODOpos
- TODO
org.xml.sax.SAXException
public void fatal(java.lang.String message) throws org.xml.sax.SAXException
message
- the message
org.xml.sax.SAXException
org.xml.sax.SAXParseException
public void err(java.lang.String message) throws org.xml.sax.SAXException
message
- the message
org.xml.sax.SAXException
public void errTreeBuilder(java.lang.String message) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void warn(java.lang.String message) throws org.xml.sax.SAXException
message
- the message
org.xml.sax.SAXException
protected void startErrorReporting() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void start() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public boolean tokenizeBuffer(UTF16Buffer buffer) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected int transition(int from, int to, boolean reconsume, int pos) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void silentCarriageReturn()
protected void silentLineFeed()
public void eof() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected char checkChar(char[] buf, int pos) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public boolean isAlreadyComplainedAboutNonAscii()
public boolean internalEncodingDeclaration(java.lang.String internalCharset) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void end() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void requestSuspension()
public void becomeConfident()
public boolean isNextCharOnNewLine()
public boolean isPrevCR()
public int getLine()
public int getCol()
public boolean isInDataState()
public void resetToDataState()
public void loadState(Tokenizer other) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void initializeWithoutStarting() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errGarbageAfterLtSlash() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errLtSlashGt() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errWarnLtSlashInRcdata() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errHtml4LtSlashInRcdata(char folded) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errCharRefLacksSemicolon() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoDigitsInNCR() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errGtInSystemId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errGtInPublicId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNamelessDoctype() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errConsecutiveHyphens() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errPrematureEndOfComment() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errBogusComment() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errUnquotedAttributeValOrNull(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errSlashNotFollowedByGt() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errHtml4XmlVoidSyntax() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoSpaceBetweenAttributes() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errHtml4NonNameInUnquotedAttribute(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errLtOrEqualsOrGraveInUnquotedAttributeOrNull(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errAttributeValueMissing() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errBadCharBeforeAttributeNameOrNull(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEqualsSignBeforeAttributeName() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errBadCharAfterLt(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errLtGt() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errProcessingInstruction() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errUnescapedAmpersandInterpretedAsCharacterReference() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNotSemicolonTerminated() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoNamedCharacterMatch() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errQuoteBeforeAttributeName(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errQuoteOrLtInAttributeNameOrNull(char c) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errExpectedPublicId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errBogusDoctype() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void maybeWarnPrivateUseAstral() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void maybeWarnPrivateUse(char ch) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void maybeErrSlashInEndTag(boolean selfClosing) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected char errNcrNonCharacter(char ch) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errAstralNonCharacter(int ch) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrSurrogate() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected char errNcrControlChar(char ch) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrCr() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrInC1Range() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInPublicId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInComment() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInDoctype() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInAttributeValue() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInAttributeName() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofWithoutGt() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInTagName() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInEndTag() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofAfterLt() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrOutOfRange() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrUnassigned() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errDuplicateAttribute() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errEofInSystemId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errExpectedSystemId() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errMissingSpaceBeforeDoctypeName() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errHyphenHyphenBang() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrControlChar() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNcrZero() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoSpaceBetweenDoctypeSystemKeywordAndQuote() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoSpaceBetweenPublicAndSystemIds() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void errNoSpaceBetweenDoctypePublicKeywordAndQuote() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void noteAttributeWithoutValue() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void noteUnquotedAttributeValue() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void setEncodingDeclarationHandler(EncodingDeclarationHandler encodingDeclarationHandler)
encodingDeclarationHandler
- the encodingDeclarationHandler to setpublic void setTransitionBaseOffset(int offset)
TransitionHandler
.
offset
- the offset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |