ResourceExpression re = pf.createResourceExpression();
Expression resourceExpr = null;
if(virtual) {
VirtualNameOrReference resourceName = pf.createVirtualNameOrReference();
resourceName.setValue(type);
resourceName.setExported(exported);
resourceExpr = resourceName;
}
else {
LiteralNameOrReference resourceName = pf.createLiteralNameOrReference();
resourceName.setValue(type);
resourceExpr = resourceName;
}
re.setResourceExpr(resourceExpr);
re.getResourceData().add(createResourceBody(additive, title, keyValPairs));