You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2012/10/15 11:11:57 UTC
svn commit: r1398225 - in
/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple:
./ SimpleCitation.java package-info.java
Author: desruisseaux
Date: Mon Oct 15 09:11:56 2012
New Revision: 1398225
URL: http://svn.apache.org/viewvc?rev=1398225&view=rev
Log:
Added an internal package for trivial implementations of some GeoAPI interfaces.
This package is needed when we can not depend on a downstream module. For example
sis-utility can not depend on sis-metadata, so it can not use DefaultCitation.
Added:
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java (with props)
sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java (with props)
Added: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java?rev=1398225&view=auto
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java (added)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java Mon Oct 15 09:11:56 2012
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.simple;
+
+import java.util.Date;
+import java.util.Collection;
+import java.util.Collections;
+import java.io.Serializable;
+
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.PresentationForm;
+import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.citation.Series;
+import org.opengis.util.InternationalString;
+
+import org.apache.sis.util.type.SimpleInternationalString;
+
+
+/**
+ * A trivial implementation of {@link Citation}.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @since 0.3 (derived from geotk-3.19)
+ * @version 0.3
+ * @module
+ */
+public class SimpleCitation implements Citation, Serializable {
+ /**
+ * For cross-version compatibility.
+ */
+ private static final long serialVersionUID = -1490465918703910949L;
+
+ /**
+ * The title to be returned by {@link #getTitle()}.
+ */
+ protected final String title;
+
+ /**
+ * Creates a new object for the given name.
+ *
+ * @param title The title to be returned by {@link #getTitle()}.
+ */
+ public SimpleCitation(final String title) {
+ this.title = title;
+ }
+
+ /**
+ * Returns the title as an international string.
+ */
+ @Override
+ public InternationalString getTitle() {
+ return new SimpleInternationalString(title);
+ }
+
+ /**
+ * Methods inherited from the {@link Citation} interface which are
+ * not of interest to this {@code SimpleCitation} implementation.
+ * Those methods will be removed in the JDK8 branch.
+ */
+ @Override public Collection<InternationalString> getAlternateTitles() {return Collections.emptyList();}
+ @Override public Collection<CitationDate> getDates() {return Collections.emptyList();}
+ @Override public InternationalString getEdition() {return null;}
+ @Override public Date getEditionDate() {return null;}
+ @Override public Collection<? extends Identifier> getIdentifiers() {return Collections.emptyList();}
+ @Override public Collection<ResponsibleParty> getCitedResponsibleParties() {return Collections.emptyList();}
+ @Override public Collection<PresentationForm> getPresentationForms() {return Collections.emptyList();}
+ @Override public Series getSeries() {return null;}
+ @Override public InternationalString getOtherCitationDetails() {return null;}
+ @Override public InternationalString getCollectiveTitle() {return null;}
+ @Override public String getISBN() {return null;}
+ @Override public String getISSN() {return null;}
+
+ /**
+ * Returns a string representation of this citation.
+ */
+ @Override
+ public String toString() {
+ return "Citation[\"" + title + "\"]";
+ }
+}
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java?rev=1398225&view=auto
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java (added)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java Mon Oct 15 09:11:56 2012
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Simple implementations of some ISO interfaces.
+ *
+ * <STRONG>Do not use!</STRONG>
+ *
+ * This package is for internal use by SIS only. Classes in this package
+ * may change in incompatible ways in any future version without notice.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @since 0.3 (derived from geotk-3.19)
+ * @version 0.3
+ * @module
+ */
+package org.apache.sis.internal.simple;
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/simple/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain