com.igormaznitsa.jbbp.plugin.common.converters.ParserFlags Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbbp-maven-plugin Show documentation
Show all versions of jbbp-maven-plugin Show documentation
Generator of sources from JBBP scripts
package com.igormaznitsa.jbbp.plugin.common.converters;
import com.igormaznitsa.jbbp.JBBPParser;
import java.util.Set;
import javax.annotation.Nullable;
/**
* Allowed parser flags.
*
* @since 1.3.0
*/
public enum ParserFlags {
/**
* Do not throw exception if input stream ended unexpectedly and not all
* fields have been read.
*/
SKIP_REMAINING_FIELDS_IF_EOF(JBBPParser.FLAG_SKIP_REMAINING_FIELDS_IF_EOF);
private final int flag;
ParserFlags(final int flag) {
this.flag = flag;
}
public static int makeFromSet(@Nullable final Set set) {
int result = 0;
if (set != null) {
for (final ParserFlags f : set) {
result |= f.getFlag();
}
}
return result;
}
/**
* Get the flag value.
*
* @return the flag value as integer
*/
public int getFlag() {
return this.flag;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy