use of pcgen.persistence.PersistenceLayerException in project pcgen by PCGen.
the class PreHDWriter method write.
/**
* @see pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface#write(java.io.Writer, pcgen.core.prereq.Prerequisite)
*/
@Override
public void write(Writer writer, Prerequisite prereq) throws PersistenceLayerException {
checkValidOperator(prereq, operatorsHandled());
try {
if (prereq.getOperator().equals(PrerequisiteOperator.LT)) {
writer.write('!');
writer.write("PREHD:" + (prereq.isOverrideQualify() ? "Q:" : "") + "MIN=");
writer.write(prereq.getOperand());
} else if (prereq.getOperator().equals(PrerequisiteOperator.GT)) {
writer.write('!');
writer.write("PREHD:" + (prereq.isOverrideQualify() ? "Q:" : "") + "MAX=");
writer.write(prereq.getOperand());
} else if (prereq.getOperator().equals(PrerequisiteOperator.GTEQ)) {
writer.write("PREHD:" + (prereq.isOverrideQualify() ? "Q:" : "") + "MIN=");
writer.write(prereq.getOperand());
} else if (prereq.getOperator().equals(PrerequisiteOperator.LTEQ)) {
writer.write("PREHD:" + (prereq.isOverrideQualify() ? "Q:" : "") + "MAX=");
writer.write(prereq.getOperand());
}
} catch (IOException e) {
throw new PersistenceLayerException(e.getMessage());
}
}
use of pcgen.persistence.PersistenceLayerException in project pcgen by PCGen.
the class PreHandsWriter method write.
/**
* @see pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface#write(java.io.Writer, pcgen.core.prereq.Prerequisite)
*/
@Override
public void write(Writer writer, Prerequisite prereq) throws PersistenceLayerException {
try {
writer.write("PREHANDS" + (prereq.isOverrideQualify() ? "Q:" : ""));
writer.write(prereq.getOperator().toString().toUpperCase());
writer.write(':');
writer.write(prereq.getOperand());
} catch (IOException e) {
throw new PersistenceLayerException(e.getMessage());
}
}
use of pcgen.persistence.PersistenceLayerException in project pcgen by PCGen.
the class PreHasDeityWriter method write.
/**
* @see pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface#write(java.io.Writer, pcgen.core.prereq.Prerequisite)
*/
@Override
public void write(Writer writer, Prerequisite prereq) throws PersistenceLayerException {
checkValidOperator(prereq, operatorsHandled());
try {
if (prereq.getOperator().equals(PrerequisiteOperator.NEQ) || prereq.getOperator().equals(PrerequisiteOperator.LT)) {
writer.write('!');
}
writer.write("PREDEITY:" + (prereq.isOverrideQualify() ? "Q:" : ""));
writer.write(prereq.getOperand());
writer.write(",");
writer.write(prereq.getKey());
} catch (IOException e) {
throw new PersistenceLayerException(e.getMessage());
}
}
use of pcgen.persistence.PersistenceLayerException in project pcgen by PCGen.
the class PreLevelMaxWriter method write.
/**
* @see pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface#write(java.io.Writer, pcgen.core.prereq.Prerequisite)
*/
@Override
public void write(Writer writer, Prerequisite prereq) throws PersistenceLayerException {
checkValidOperator(prereq, operatorsHandled());
try {
if (prereq.getOperator().equals(PrerequisiteOperator.GT)) {
writer.write('!');
}
writer.write("PRELEVELMAX:" + (prereq.isOverrideQualify() ? "Q:" : ""));
writer.write(prereq.getOperand());
} catch (IOException e) {
throw new PersistenceLayerException(e.getMessage());
}
}
use of pcgen.persistence.PersistenceLayerException in project pcgen by PCGen.
the class PreLanguageWriter method write.
/**
* @see pcgen.persistence.lst.output.prereq.PrerequisiteWriterInterface#write(java.io.Writer, pcgen.core.prereq.Prerequisite)
*/
@Override
public void write(Writer writer, Prerequisite prereq) throws PersistenceLayerException {
checkValidOperator(prereq, operatorsHandled());
try {
if (prereq.getOperator().equals(PrerequisiteOperator.LT)) {
writer.write('!');
}
writer.write("PRELANG:" + (prereq.isOverrideQualify() ? "Q:" : ""));
writer.write(prereq.getOperand());
writer.write(',');
writer.write(prereq.getKey());
} catch (IOException e) {
throw new PersistenceLayerException(e.getMessage());
}
}
Aggregations