com.itextpdf.styledxmlparser.jsoup.parser.ParseErrorList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of styled-xml-parser Show documentation
Show all versions of styled-xml-parser Show documentation
Styled XML parser is used by iText7 modules to parse HTML and XML
The newest version!
/*
This file is part of jsoup, see NOTICE.txt in the root of the repository.
It may contain modifications beyond the original version.
*/
package com.itextpdf.styledxmlparser.jsoup.parser;
import java.util.ArrayList;
/**
* A container for ParseErrors.
*/
public class ParseErrorList extends ArrayList{
private static final int INITIAL_CAPACITY = 16;
private final int initialCapacity;
private final int maxSize;
ParseErrorList(int initialCapacity, int maxSize) {
super(initialCapacity);
this.initialCapacity = initialCapacity;
this.maxSize = maxSize;
}
/**
Create a new ParseErrorList with the same settings, but no errors in the list
@param copy initial and max size details to copy
*/
ParseErrorList(ParseErrorList copy) {
this(copy.initialCapacity, copy.maxSize);
}
boolean canAddError() {
return size() < maxSize;
}
int getMaxSize() {
return maxSize;
}
public static ParseErrorList noTracking() {
return new ParseErrorList(0, 0);
}
public static ParseErrorList tracking(int maxSize) {
return new ParseErrorList(INITIAL_CAPACITY, maxSize);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy