Package org.apache.solr.common.util
Interface TextWriter
- All Superinterfaces:
AutoCloseable,Closeable,PushWriter
- All Known Subinterfaces:
JsonTextWriter
Base interface for all text based writers
-
Method Summary
Modifier and TypeMethodDescriptionintdecLevel()booleandoIndent()intincLevel()default voidindent()default voidindent(int lev) intlevel()setIndent(boolean doIndent) default voidwriteArray(String name, Object[] val, boolean raw) voidwriteArray(String name, Iterator<?> val, boolean raw) voidwriteArray(String name, Iterator<?> val, int size, boolean raw) default voidwriteArray(String name, List<?> l, boolean raw) default voiddefault voidvoidif this form of the method is called, val is the Java string form of a booleandefault voidwriteByteArr(String name, byte[] buf, int offset, int len) voidif this form of the method is called, val is the Solr ISO8601 based date formatdefault voiddefault voidwriteDouble(String name, double val) voidwriteDouble(String name, String val) if this form of the method is called, val is the Java string form of a doubledefault voidwriteFloat(String name, float val) voidwriteFloat(String name, String val) if this form of the method is called, val is the Java string form of a floatdefault voidvoidif this form of the method is called, val is the Java string form of an intdefault voidwriteIterator(String name, IteratorWriter iw, boolean raw) default voidWrite an array.default voidvoidif this form of the method is called, val is the Java string form of a longvoiddefault voiddefault voidWrite a Map.voidwriteNamedList(String name, NamedList<?> val) voiddefault voidwriteNumber(String name, Number val) voiddefault voidwriteStrRaw(String name, String val) Writes the specified val directly to the backing writer, without wrapping (e.g., in quotes) or escaping of any kind.default voiddefault void
-
Method Details
-
writeVal
- Throws:
IOException
-
writeVal
- Throws:
IOException
-
writeStrRaw
Writes the specified val directly to the backing writer, without wrapping (e.g., in quotes) or escaping of any kind.- Throws:
IOException
-
writeStr
- Throws:
IOException
-
writeMap
void writeMap(String name, Map<?, ?> val, boolean excludeOuter, boolean isFirstVal) throws IOException- Throws:
IOException
-
writeArray
- Throws:
IOException
-
writeArray
- Throws:
IOException
-
writeNull
- Throws:
IOException
-
writeInt
if this form of the method is called, val is the Java string form of an int- Throws:
IOException
-
writeLong
if this form of the method is called, val is the Java string form of a long- Throws:
IOException
-
writeBool
if this form of the method is called, val is the Java string form of a boolean- Throws:
IOException
-
writeFloat
if this form of the method is called, val is the Java string form of a float- Throws:
IOException
-
writeDouble
if this form of the method is called, val is the Java string form of a double- Throws:
IOException
-
writeDate
if this form of the method is called, val is the Solr ISO8601 based date format- Throws:
IOException
-
writeNamedList
- Throws:
IOException
-
getWriter
Writer getWriter() -
writeNumber
- Throws:
IOException
-
writeArray
- Throws:
IOException
-
writeArray
- Throws:
IOException
-
writeDate
- Throws:
IOException
-
writeByteArr
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeLong
- Throws:
IOException
-
writeBool
- Throws:
IOException
-
writeFloat
- Throws:
IOException
-
writeDouble
- Throws:
IOException
-
writeBool
- Throws:
IOException
-
writeMap
Description copied from interface:PushWriterWrite a Map. The map is opened in the beginning of the method and closed at the end. All map entries MUST be written before this method returns- Specified by:
writeMapin interfacePushWriter- Throws:
IOException
-
writeMap
- Throws:
IOException
-
writeIterator
Description copied from interface:PushWriterWrite an array. The array is opened at the beginning of this method and closed at the end. All array entries must be written before this method returns- Specified by:
writeIteratorin interfacePushWriter- Throws:
IOException
-
writeIterator
- Throws:
IOException
-
indent
- Throws:
IOException
-
incLevel
int incLevel() -
decLevel
int decLevel() -
setIndent
-
level
int level() -
doIndent
boolean doIndent() -
indent
- Throws:
IOException
-