use of org.eclipse.wst.dtd.core.internal.emf.DTDRepeatableContent in project webtools.sourceediting by eclipse.
the class DTDPrinter method visitDTDElementContent.
public void visitDTDElementContent(DTDElementContent content) {
updateStartOffset(content, sb.length());
// $NON-NLS-1$
String trailingChars = "";
if (content instanceof DTDRepeatableContent) {
DTDRepeatableContent repeatContent = (DTDRepeatableContent) content;
DTDOccurrenceType occurrenceType = repeatContent.getOccurrence();
// Integer occurrence = repeatContent.getOccurrence();
if (occurrenceType != null) {
int occurType = occurrenceType.getValue();
if (occurType != DTDOccurrenceType.ONE) {
if (repeatContent instanceof DTDEntityReferenceContent) {
// $NON-NLS-1$
sb.append("(");
// $NON-NLS-1$
trailingChars = ")";
}
trailingChars += (char) occurType;
}
}
// end of if ()
}
if (content instanceof DTDGroupContent) {
super.visitDTDElementContent(content);
} else // end of if ()
if (content instanceof DTDElementReferenceContent || content instanceof DTDEntityReferenceContent) {
sb.append(((DTDRepeatableContent) content).unparseRepeatableContent());
} else // end of if ()
{
// handle DTDPCDataContent, DTDAnyContent and DTDEmptyContent here
sb.append(content.getContentName());
}
// end of else
sb.append(trailingChars);
updateEndOffset(content, sb.length());
}
Aggregations