use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.
the class FreeMarkerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
if (!classSetUpRun) {
classSetUp();
classSetUpRun = true;
}
CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
wiFacet.initialize(dsid);
}
use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.
the class FactKeyActorTest method testListKeyActorMissingSafe.
public void testListKeyActorMissingSafe() {
NumberManager mgr = new NumberManager();
FactKey<Number> fk = FactKey.getConstant("cost", mgr);
FactKeyActor<?> ika = new FactKeyActor<>(fk);
CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
wiFacet.set(dsid, Deity.class, "cost", ika);
processThroughFreeMarker("${deity.cost!}", "");
}
use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.
the class FactKeyActorTest method testFactKeyActor.
public void testFactKeyActor() {
Deity d = new Deity();
d.setName("Bob");
Integer expectedResult = 475;
df.set(id, d);
NumberManager mgr = new NumberManager();
FactKey<Number> fk = FactKey.getConstant("cost", mgr);
d.put(fk, new BasicIndirect<>(mgr, expectedResult));
FactKeyActor<?> ika = new FactKeyActor<>(fk);
CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
wiFacet.set(dsid, d.getClass(), "cost", ika);
processThroughFreeMarker("${deity.cost}", expectedResult.toString());
}
use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.
the class FactSetDefinition method activateOutput.
/**
* @see pcgen.cdom.content.ContentDefinition#activateOutput(DataSetID)
*/
@Override
protected void activateOutput(DataSetID dsID) {
FactSetKeyActor<F> fca = new FactSetKeyActor<>(getFactSetKey());
CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
if (!wiFacet.set(dsID, getUsableLocation(), factSetName.toLowerCase(), fca)) {
Logging.errorPrint(getUsableLocation().getSimpleName() + " output " + factSetName.toLowerCase() + " already exists, ignoring Visibility to EXPORT for FACTSET: " + factSetName);
}
}
use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.
the class FactDefinition method activateOutput.
/**
* @see pcgen.cdom.content.ContentDefinition#activateOutput(DataSetID)
*/
@Override
protected void activateOutput(DataSetID dsID) {
FactKeyActor<?> fca = new FactKeyActor<>(getFactKey());
CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
if (!wiFacet.set(dsID, getUsableLocation(), factName.toLowerCase(), fca)) {
Logging.errorPrint(getUsableLocation().getSimpleName() + " output " + factName.toLowerCase() + " already exists, ignoring Visibility to EXPORT for FACT: " + factName);
}
}
Aggregations