public class XmlAttributeLiteralEscaper extends LiteralTextEscaper<XmlAttributeValueImpl>
myHost
Constructor and Description |
---|
XmlAttributeLiteralEscaper(XmlAttributeValueImpl host) |
Modifier and Type | Method and Description |
---|---|
boolean |
decode(TextRange rangeInsideHost,
java.lang.StringBuilder outChars)
Add decoded and unescaped characters from the host element to
outChars buffer. |
int |
getOffsetInHost(int offsetInDecoded,
TextRange rangeInsideHost)
This method is called only after
LiteralTextEscaper.decode(com.intellij.openapi.util.TextRange, java.lang.StringBuilder) , so it's possible to prepare necessary data in LiteralTextEscaper.decode(com.intellij.openapi.util.TextRange, java.lang.StringBuilder) and then use it here. |
TextRange |
getRelevantTextRange() |
boolean |
isOneLine() |
createSimple
public XmlAttributeLiteralEscaper(XmlAttributeValueImpl host)
public boolean decode(TextRange rangeInsideHost, java.lang.StringBuilder outChars)
LiteralTextEscaper
outChars
buffer. If it's impossible to properly decode some chars
from the specified range (e.g. if the range starts or ends inside escaped sequence), decode the longest acceptable prefix of the range and return false
decode
in class LiteralTextEscaper<XmlAttributeValueImpl>
rangeInsideHost
- range to be decoded. It's guarantied to be inside LiteralTextEscaper.getRelevantTextRange()
outChars
- buffer for output chars. Use append
methods only, it's forbidden to modify or remove existing characterstrue
if whole range was successfully decoded, false
otherwisepublic int getOffsetInHost(int offsetInDecoded, TextRange rangeInsideHost)
LiteralTextEscaper
LiteralTextEscaper.decode(com.intellij.openapi.util.TextRange, java.lang.StringBuilder)
, so it's possible to prepare necessary data in LiteralTextEscaper.decode(com.intellij.openapi.util.TextRange, java.lang.StringBuilder)
and then use it here.getOffsetInHost
in class LiteralTextEscaper<XmlAttributeValueImpl>
offsetInDecoded
- offset in the parsed injected filerangeInsideHost
- range where injection is performed,
E.g. if some language fragment xyz was injected into string literal expression "xyz", then rangeInsideHost = (1,4)public boolean isOneLine()
isOneLine
in class LiteralTextEscaper<XmlAttributeValueImpl>
true
if the host cannot accept multiline content, false
otherwisepublic TextRange getRelevantTextRange()
getRelevantTextRange
in class LiteralTextEscaper<XmlAttributeValueImpl>