logger.debug("logger called, " + prefix + ":" + elementName + " in context of: " + contextObject.toString());
if (contextObject instanceof LayoutModelPlugin) {
LayoutModelPlugin layoutModel = (LayoutModelPlugin) contextObject;
// TODO not sure if necessary to check if listOfLayouts != null
ListOf<Layout> listOfLayouts = layoutModel.getListOfLayouts();
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfGlobalRenderInformation)) {
RenderListOfLayoutsPlugin renderPlugin = new RenderListOfLayoutsPlugin(listOfLayouts);
listOfLayouts.addExtension(RenderConstants.namespaceURI, renderPlugin);
newElement = renderPlugin.getListOfGlobalRenderInformation();
}
if (newElement != null) {
listOfLayouts.registerChild(newElement);
return newElement;
}
}
else if (contextObject instanceof Layout) {
Layout layout = (Layout) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfLocalRenderInformation)) {
RenderLayoutPlugin renderPlugin = new RenderLayoutPlugin(layout);
layout.addExtension(RenderConstants.namespaceURI, renderPlugin);
newElement = renderPlugin.getListOfLocalRenderInformation();
}
if (newElement != null) {
layout.registerChild(newElement);
return newElement;
}
}
else if (contextObject instanceof RenderInformationBase) {
RenderInformationBase renderInformation = (RenderInformationBase) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfGradientDefinitions)) {
newElement = renderInformation.getListOfGradientDefintions();
}
if (elementName.equals(RenderConstants.listOfColorDefinitions)) {
newElement = renderInformation.getListOfColorDefinitions();
}
if (elementName.equals(RenderConstants.listOfLineEndings)) {
newElement = renderInformation.getListOfLineEndings();
}
if (renderInformation instanceof GlobalRenderInformation) {
GlobalRenderInformation globalRenderInformation =
(GlobalRenderInformation) renderInformation;
if (elementName.equals(RenderConstants.listOfStyles)) {
newElement = globalRenderInformation.getListOfStyles();
}
}
if (renderInformation instanceof LocalRenderInformation) {
LocalRenderInformation localRenderInformation =
(LocalRenderInformation) renderInformation;
if (elementName.equals(RenderConstants.listOfLocalStyles)) {
newElement = localRenderInformation.getListOfLocalStyles();
}
}
if (newElement != null) {
renderInformation.registerChild(newElement);
return newElement;
}
}
else if (contextObject instanceof Style) {
Style style = (Style) contextObject;
if (elementName.equals(RenderConstants.group)) {
Group g = new Group();
style.setGroup(g);
return g;
}
}
else if (contextObject instanceof Polygon) {
Polygon polygon = (Polygon) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfElements)) {
newElement = polygon.getListOfElements();
}
if (newElement != null) {
polygon.registerChild(newElement);
return newElement;
}
}
else if (contextObject instanceof LineEnding) {
LineEnding lineEnding = (LineEnding) contextObject;
if (elementName.equals(RenderConstants.boundingBox)) {
BoundingBox bbox = new BoundingBox();
lineEnding.setBoundingBox(bbox);
return bbox;
}
else if (elementName.equals(RenderConstants.group)) {
Group g = new Group();
lineEnding.setGroup(g);
return g;
}
}
else if (contextObject instanceof Curve) {
Curve curve = (Curve) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfElements)) {
newElement = curve.getListOfElements();
}
if (newElement != null) {
curve.registerChild(newElement);
return newElement;
}
}
else if (contextObject instanceof GradientBase) {
GradientBase gradientBase = (GradientBase) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.listOfGradientStops)) {
newElement = gradientBase.getListOfGradientStops();
}
if (newElement != null) {
gradientBase.registerChild(newElement);
return newElement;
}
}
/**
* parsing lists
*/
else if (contextObject instanceof ListOf<?>) {
ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
SBase newElement = null;
if (elementName.equals(RenderConstants.renderPoint)) {
newElement = new RenderPoint();
}
else if (elementName.equals(RenderConstants.style)) {