@Override public <T> void convert(MetadataParser<T> p, Object expressionsNode) { if (anIf == null) { throw com.redhat.lightblue.util.Error.get( RDBMSConstants.ERR_FIELD_REQUIRED, "No if informed"); } if (then == null) { throw com.redhat.lightblue.util.Error.get( RDBMSConstants.ERR_FIELD_REQUIRED, "No then informed"); } T eT = p.newNode(); T iT = p.newNode(); anIf.convert(p, null, iT); p.putObject(eT, "if", iT); then.convert(p, null, eT); if (elseIfList != null && !elseIfList.isEmpty()) { Object arri = p.newArrayField(eT, "elseIf"); for (ElseIf e : elseIfList) { e.convert(p, arri, null); } } if (anElse != null) { anElse.convert(p, null, eT); } p.addObjectToArray(expressionsNode, eT); }
/** * Write the else condition in this condition to the specified content handler. * * @param outputHandler The content handler to write to. * @throws NullPointerException If the supplied content handler is <code>null</code>. * @throws SAXException If the writing of one of the actions fails. */ protected void writeElse(ContentHandler outputHandler) throws NullPointerException, SAXException { if (elseClause != null) elseClause.writeWidget(outputHandler); }