org.kefirsf.bb.proc.PatternJunk Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kefirbb Show documentation
Show all versions of kefirbb Show documentation
KefirBB is a Java-library for text processing. Initially it was developed for BB2HTML translation.
But flexible configuration allows to use it in different cases. For example for parsing Markdown, Textile,
and for HTML filtration.
The newest version!
package org.kefirsf.bb.proc;
/**
* @author Vitalii Samolovskikh aka Kefir
*/
public class PatternJunk implements ProcPatternElement {
public boolean parse(Context context, ProcPatternElement terminator) {
Source source = context.getSource();
int offset = source.getOffset();
int end;
if (terminator != null) {
end = terminator.findIn(context.getSource());
} else {
end = context.getSource().length();
}
if (end >= 0) {
source.incOffset(end - offset);
return true;
} else {
return false;
}
}
public boolean isNextIn(Context context) {
return false;
}
public int findIn(Source source) {
return -1;
}
@Override
public String toString() {
return " ";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy