/** * Formats this formula as a pseudo-<cite>Well Known Text</cite> element. * * <div class="note"><b>Compatibility note:</b> * ISO 19162 does not define a WKT representation for {@code Formula} objects. * The text formatted by this method is SIS-specific and causes the text to be * flagged as {@linkplain Formatter#setInvalidWKT(Class, Exception) invalid WKT}. * The WKT content of this element may change in any future SIS version.</div> * * @return {@code "Formula"}. */ @Override protected String formatTo(final Formatter formatter) { InternationalString text = null; final Citation citation = getCitation(); // Gives to users a chance to override properties. if (citation != null) { text = citation.getTitle(); } if (text == null) { text = getFormula(); } if (text != null) { formatter.append(text.toString(formatter.getLocale()), ElementKind.REMARKS); } formatter.setInvalidWKT(Formula.class, null); return WKTKeywords.Formula; } }
/** * Formats this formula as a pseudo-<cite>Well Known Text</cite> element. * * <div class="note"><b>Compatibility note:</b> * ISO 19162 does not define a WKT representation for {@code Formula} objects. * The text formatted by this method is SIS-specific and causes the text to be * flagged as {@linkplain Formatter#setInvalidWKT(Class, Exception) invalid WKT}. * The WKT content of this element may change in any future SIS version.</div> * * @return {@code "Formula"}. */ @Override protected String formatTo(final Formatter formatter) { InternationalString text = null; final Citation citation = getCitation(); // Gives to users a chance to override properties. if (citation != null) { text = citation.getTitle(); } if (text == null) { text = getFormula(); } if (text != null) { formatter.append(text.toString(formatter.getLocale()), ElementKind.REMARKS); } formatter.setInvalidWKT(Formula.class, null); return WKTKeywords.Formula; } }