Java Examples for org.relaxer.vocabulary.forrest_0_5.document_v12.FdCode

The following java examples will help you to understand the usage of org.relaxer.vocabulary.forrest_0_5.document_v12.FdCode. These source code samples are taken from different open source projects.

Example 1
Project: xmlsmartdoc-master  File: DocumentV12Generator.java View source code
//
private void addContent_(Object target, Object context) {
    if (context instanceof FdBody) {
        if (target instanceof IFdBodyChoice) {
            ((FdBody) context).addContent((IFdBodyChoice) target);
        } else {
            String message = target + " is illegal in <body>";
            monitor_.warning(message);
            FdP p = new FdP();
            p.addContent("[" + message + "]");
            ((FdBody) context).addContent(p);
        }
    } else if (context instanceof FdSection) {
        if (target instanceof IFdSectionChoice) {
            ((FdSection) context).addContent((IFdSectionChoice) target);
        } else {
            String message = target + " is illegal in <section>";
            monitor_.warning(message);
            FdP p = new FdP();
            p.addContent(message);
            ((FdSection) context).addContent(p);
        }
    } else if (context instanceof FdP) {
        if (target instanceof String) {
            ((FdP) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdP) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <p>";
            monitor_.warning(message);
            ((FdP) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdTitle) {
        if (target instanceof String) {
            ((FdTitle) context).addContent(_escape((String) target));
        } else if (target instanceof IFdTitleMixed) {
            ((FdTitle) context).addContent((IFdTitleMixed) target);
        } else {
            String message = target + " is illegal in <title>";
            monitor_.warning(message);
            ((FdTitle) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdUl) {
        if (target instanceof IFdUlChoice) {
            ((FdUl) context).addContent((IFdUlChoice) target);
        } else {
            String message = target + " is illegal in <ul>";
            monitor_.warning(message);
            FdLi li = new FdLi();
            li.addContent("[" + message + "]");
            ((FdUl) context).addContent(li);
        }
    } else if (context instanceof FdOl) {
        if (target instanceof IFdOlChoice) {
            ((FdOl) context).addContent((IFdOlChoice) target);
        } else {
            String message = target + " is illegal in <ol>";
            monitor_.warning(message);
            FdLi li = new FdLi();
            li.addContent("[" + message + "]");
            ((FdOl) context).addContent(li);
        }
    } else if (context instanceof FdLi) {
        if (target instanceof String) {
            ((FdLi) context).addContent(_escape((String) target));
        } else if (target instanceof IFdFlowMixed) {
            ((FdLi) context).addContent((IFdFlowMixed) target);
        } else {
            String message = target + " is illegal in <li>";
            monitor_.warning(message);
            ((FdLi) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdDt) {
        if (target instanceof String) {
            ((FdDt) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdDt) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <dt>";
            monitor_.warning(message);
            ((FdDt) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdDd) {
        if (target instanceof String) {
            ((FdDd) context).addContent(_escape((String) target));
        } else if (target instanceof IFdFlowMixed) {
            ((FdDd) context).addContent((IFdFlowMixed) target);
        } else {
            String message = target + " is illegal in <dd>";
            monitor_.warning(message);
            ((FdDd) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdTd) {
        if (target instanceof String) {
            ((FdTd) context).addContent(_escape((String) target));
        } else if (target instanceof IFdFlowMixed) {
            ((FdTd) context).addContent((IFdFlowMixed) target);
        } else {
            String message = target + " is illegal in <td>";
            monitor_.warning(message);
            ((FdTd) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdTh) {
        if (target instanceof String) {
            ((FdTh) context).addContent(_escape((String) target));
        } else if (target instanceof IFdFlowMixed) {
            ((FdTh) context).addContent((IFdFlowMixed) target);
        } else {
            String message = target + " is illegal in <th>";
            monitor_.warning(message);
            ((FdTh) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdCaption) {
        if (target instanceof String) {
            ((FdCaption) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdCaption) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <caption>";
            monitor_.warning(message);
            ((FdCaption) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdLink) {
        if (target instanceof String) {
            ((FdLink) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdLink) context).addContent((IFdLinkContentMixMixed) target);
        } else {
            String message = target + " is illegal in <link>";
            monitor_.warning(message);
            ((FdLink) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdJump) {
        if (target instanceof String) {
            ((FdJump) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdJump) context).addContent((IFdLinkContentMixMixed) target);
        } else {
            String message = target + " is illegal in <jump>";
            monitor_.warning(message);
            ((FdJump) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdSource) {
        if (target instanceof String) {
            ((FdSource) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdSource) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <source>";
            monitor_.warning(message);
            ((FdSource) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdCode) {
        if (target instanceof String) {
            ((FdCode) context).setContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            String message = target + " is illegal in <code>";
            monitor_.warning(message);
            ((FdSource) context).addContent("[" + message + "]");
        } else {
            String message = target + " is illegal in <code>";
            monitor_.warning(message);
            ((FdSource) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdStrong) {
        if (target instanceof String) {
            ((FdStrong) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdStrong) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <strong>";
            monitor_.warning(message);
            ((FdStrong) context).addContent("[" + message + "]");
        }
    } else if (context instanceof FdEm) {
        if (target instanceof String) {
            ((FdEm) context).addContent(_escape((String) target));
        } else if (target instanceof IFdContentMixMixed) {
            ((FdEm) context).addContent((IFdContentMixMixed) target);
        } else {
            String message = target + " is illegal in <em>";
            monitor_.warning(message);
            ((FdStrong) context).addContent("[" + message + "]");
        }
    } else {
        throw (new UnsupportedOperationException(context.toString()));
    }
}