Class StringCodecQuote
java.lang.Object
org.aksw.commons.codec.string.impl.StringCodecQuote
- All Implemented Interfaces:
EntityCodec<String>,EntityCodecDirect<String>,EntityCodecDirectBase<String>,EntityCodecIndirect<String>,StringCodec,StringCodecDirectBase
StringCodec that prepends and appends a quote char to a given string
and also escapes any occurrence of the quote char within the string with an escape char.
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic StringCodecQuotecreate(char quoteChar) static StringCodecQuotecreate(char quoteChar, char escapeChar) charcharMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.codec.entity.api.EntityCodecDirect
decodeOrGetAsGivenMethods inherited from interface org.aksw.commons.codec.entity.api.EntityCodecDirectBase
asEntityCodec, getDecoder, getEncoder
-
Field Details
-
quoteChar
protected final char quoteChar -
escapeChar
protected final char escapeChar
-
-
Constructor Details
-
StringCodecQuote
public StringCodecQuote(char quoteChar, char escapeChar)
-
-
Method Details
-
getQuoteChar
public char getQuoteChar() -
getEscapeChar
public char getEscapeChar() -
encode
- Specified by:
encodein interfaceEntityCodecDirect<String>
-
canDecode
- Specified by:
canDecodein interfaceEntityCodecDirect<String>
-
decode
- Specified by:
decodein interfaceEntityCodecDirect<String>
-
create
-
create
-