--- trunk/src/skrueger/AttributeMetaData.java 2009/07/14 15:57:19 224
+++ branches/2.3-KECK/src/skrueger/AttributeMetadataInterface.java 2010/10/14 09:44:10 1102
@@ -1,88 +1,122 @@
-package skrueger;
-
-import org.apache.log4j.Logger;
-
-import skrueger.geotools.StyledLayerInterface;
-import skrueger.i8n.Translation;
-
-/**
- * This class holds meta information about an attribute/column. This
- * information is used by {@link StyledLayerInterface}.
- *
- * @author Stefan Alfons Krüger
- */
-public class AttributeMetaData {
- static private final Logger LOGGER = Logger
- .getLogger(AttributeMetaData.class);
- protected Translation title = new Translation();
- protected Translation desc = new Translation();
- protected boolean visible = false;
- protected String unit = "";
- protected int colIdx;
-
- /**
- * Creates an {@link AttributeMetaData} object with the following information
- * @param colIdx The column index of this attribute in the underlying table/dbf/etc...
- * @param visible Shall this attribute be displayed or hidden from the user?
- * @param title {@link Translation} for Name
- * @param desc {@link Translation} for an attribute description
- * @param unit {@link String} of the unit that the information is in
- */
- public AttributeMetaData(final int colIdx, final Boolean visible,
- final Translation title, final Translation desc, final String unit) {
-
- this.colIdx = colIdx;
- this.title = title;
- this.desc = desc;
- if (colIdx == 0){
- // The first attribut is THE_GEOM and shall never be visible!
- this.visible = false;
- }else
- this.visible = visible;
- this.unit = unit;
- }
-
- /**
- * Creates a new visible {@link AttributeMetaData} with default (no) values.
- */
- public AttributeMetaData(final Integer col, final String defaultName) {
- this(col, true, new Translation(defaultName), new Translation(), "");
- }
-
- public Boolean isVisible() {
- return visible;
- }
-
- public void setVisible(final Boolean visible) {
- this.visible = visible;
- }
-
- /** @return the index of this attribute in the underlying table/dbf **/
- public int getColIdx() {
- return colIdx;
- }
-
- public Translation getTitle() {
- return title;
- }
-
- public void setTitle(final Translation title) {
- this.title = title;
- }
-
- public Translation getDesc() {
- return desc;
- }
-
- public void setDesc(final Translation desc) {
- this.desc = desc;
- }
-
- public String getUnit() {
- return unit;
- }
-
- public void setUnit(final String unit) {
- this.unit = unit;
- }
-}
+package skrueger;
+
+import java.util.HashSet;
+
+import org.opengis.feature.type.Name;
+
+import skrueger.geotools.Copyable;
+import skrueger.i8n.Translation;
+
+public interface AttributeMetadataInterface extends Copyable,
+ Comparable {
+
+ /**
+ * @return a translatable title for this attribute..
+ */
+ public Translation getTitle();
+
+ /**
+ * Set a translatable title for this attribute..
+ */
+ public void setTitle(Translation title);
+
+ /**
+ * Set an untranslated title for this attribute or pass a {@link Translation} encryped as a {@link String}
+ */
+ public void setTitle(String title);
+
+ /**
+ * @return a translatable description for this attribute
+ */
+ public Translation getDesc();
+
+ /**
+ * Set a translatable description for this attribute.
+ */
+ public void setDesc(Translation desc);
+
+ /**
+ * Set an untranslated description for this attribute or pass a {@link Translation} encryped as a {@link String}
+ */
+ public void setDesc(String desc);
+
+
+ /**
+ * The local name. E.g. the name of the DBF column as a {@link String}.
+ */
+ public String getLocalName();
+
+ /**
+ * A short form for #setName(new NameImpl(localName))
+ */
+ public void setLocalName(String localName);
+
+ /**
+ * The fully qualified {@link Name} of the attribute, e.g.
+ * org.bla.plo:blub. The second part equals the
+ * {@link #getLocalName()} value. The first may be null or
+ * represent the layer name.
+ */
+ public Name getName();
+
+ /**
+ * set the fully qualified {@link Name} of this attribute.
+ */
+ public void setName(Name name);
+
+ /**
+ * A list og objects that represent NODATA-values for this attribute. The
+ * objects are supporsed to be correctly casted already. That means that the
+ * NODATA objects listed here have must have the same type as the values of
+ * this object.
+ */
+ public HashSet