Skip to content

Commit daf0b87

Browse files
committed
Add javadoc
1 parent 371fda9 commit daf0b87

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

Diff for: src/main/java/com/fasterxml/jackson/dataformat/xml/XmlFactoryBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class XmlFactoryBuilder extends TSFBuilder<XmlFactory, XmlFactoryBuilder>
5555
protected String _nameForTextElement;
5656

5757
/**
58-
* Set a default value in case of empty an empty element (empty XML tag)
58+
* Set a default value in case of an empty element (empty XML tag)
5959
*<p>
6060
* Value used for pseudo-property used for returning empty XML tag.
6161
* Defaults to empty String, but may be changed.

Diff for: src/main/java/com/fasterxml/jackson/dataformat/xml/XmlMapper.java

+9
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ public Builder nameForTextElement(String name) {
104104
return this;
105105
}
106106

107+
/**
108+
*
109+
* Set a default value in case of an empty element (empty XML tag)
110+
*<p>
111+
* In case of an empty XML tag (like `<no-content/>`) the serialized value
112+
* is set to `String value`. If not specified, the default value is empty String.
113+
*
114+
* @since 2.17
115+
*/
107116
public Builder valueForEmptyElement(String value) {
108117
_mapper.setValueForEmptyElement(value);
109118
return this;

Diff for: src/main/java/com/fasterxml/jackson/dataformat/xml/deser/FromXmlParser.java

+3
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ public FromXmlParser(IOContext ctxt, int genericParserFeatures, int xmlFeatures,
286286
this(ctxt, genericParserFeatures, xmlFeatures, codec, xmlReader, tagProcessor, FromXmlParser.DEFAULT_EMPTY_ELEMENT_VALUE);
287287
}
288288

289+
/**
290+
* @since 2.17
291+
*/
289292
public FromXmlParser(IOContext ctxt, int genericParserFeatures, int xmlFeatures,
290293
ObjectCodec codec, XMLStreamReader xmlReader, XmlNameProcessor tagProcessor, String valueForEmptyElement)
291294
throws IOException

Diff for: src/main/java/com/fasterxml/jackson/dataformat/xml/deser/XmlTokenStream.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public class XmlTokenStream
120120
*/
121121
protected String _textValue;
122122

123-
protected String _valueForEmptyElement;
123+
protected final String _valueForEmptyElement;
124124

125125
/**
126126
* Marker flag set if caller wants to "push back" current token so
@@ -558,7 +558,6 @@ private final int _next() throws XMLStreamException
558558

559559
/**
560560
* @return Collected text, if any, EXCEPT that if {@code FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL}
561-
* OR {@code FromXmlParser.Feature.EMPTY_ELEMENT_AS_EMPTY_ARRAY}
562561
* AND empty element, returns {@code null}
563562
*/
564563
private final String _collectUntilTag() throws XMLStreamException

0 commit comments

Comments
 (0)