/** Formats the sub-element. */ @Override protected String formatTo(final Formatter formatter) { formatter.append(value != null ? value.toString(formatter.getLocale()) : null, null); return name; } }
/** * Appends the name of the given object to the formatter. * * @param object the object from which to get the name. * @param formatter the formatter where to append the name. * @param type the key of colors to apply if syntax colors are enabled. */ public static void appendName(final IdentifiedObject object, final Formatter formatter, final ElementKind type) { String name = IdentifiedObjects.getName(object, formatter.getNameAuthority()); if (name == null) { name = IdentifiedObjects.getName(object, null); if (name == null) { name = Vocabulary.getResources(formatter.getLocale()).getString(Vocabulary.Keys.Unnamed); } } formatter.append(name, (type != null) ? type : ElementKind.NAME); }
/** * Appends the name of the given object to the formatter. * * @param object the object from which to get the name. * @param formatter the formatter where to append the name. * @param type the key of colors to apply if syntax colors are enabled. */ public static void appendName(final IdentifiedObject object, final Formatter formatter, final ElementKind type) { String name = IdentifiedObjects.getName(object, formatter.getNameAuthority()); if (name == null) { name = IdentifiedObjects.getName(object, null); if (name == null) { name = Vocabulary.getResources(formatter.getLocale()).getString(Vocabulary.Keys.Unnamed); } } formatter.append(name, (type != null) ? type : ElementKind.NAME); }
/** * 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; } }
name = IdentifiedObjects.getName(this, null); if (name == null) { name = Vocabulary.getResources(formatter.getLocale()).getString(Vocabulary.Keys.Unnamed);
name = IdentifiedObjects.getName(this, null); if (name == null) { name = Vocabulary.getResources(formatter.getLocale()).getString(Vocabulary.Keys.Unnamed);