You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public final class BTScalarElementHandler<S> implements BTElementHandlerType<Object, S>
{
private final BTCharacterHandlerType<S> handler;
private final BTQualifiedName name;
private S result;
/**
* Construct a handler.
*
* @param inName The name of elements handled by this handler
* @param inHandler The character handler
*/
public BTScalarElementHandler(
final BTQualifiedName inName,
final BTCharacterHandlerType<S> inHandler)
{
this.name = Objects.requireNonNull(inName, "name");
this.handler = Objects.requireNonNull(inHandler, "handler");
}
@Override
public String name()
{
return this.name.localName();
}
@Override
public void onCharacters(
final BTElementParsingContextType context,
final char[] data,
final int offset,
final int length)
throws Exception
{
this.result = this.handler.parse(context, data, offset, length);
}
@Override
public S onElementFinished(
final BTElementParsingContextType context)
{
return this.result;
}
}
... Might return null. The reason: A closed element such as <element/> will cause the onCharacters method not to be called, resulting in this.result being unassigned.
The text was updated successfully, but these errors were encountered:
The following scalar handler:
... Might return
null
. The reason: A closed element such as<element/>
will cause theonCharacters
method not to be called, resulting inthis.result
being unassigned.The text was updated successfully, but these errors were encountered: