Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 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.profile.france;
 
Provides implementations of French extensions defined by AFNOR.

Author(s):
Martin Desruisseaux (Geomatys)
Version:
0.4
Since:
0.4
Module:
 
 public final class FrenchProfile extends Static {
    
The URL. The usual prefix for this namespace is "fra".

 
     public static final String NAMESPACE = "http://www.cnig.gouv.fr/2005/fra";

    
Do not allow instantiation of this class.
 
     private FrenchProfile() {
     }

    
Returns the given metadata object as an AFNOR-compliant instance. The current implementation recognizes the following types:
GeoAPI typeAFNOR XML element
org.opengis.metadata.identification.DataIdentificationFRA_DataIdentification
org.opengis.metadata.constraint.ConstraintsFRA_Constraints
org.opengis.metadata.constraint.LegalConstraintsFRA_LegalConstraints
org.opengis.metadata.constraint.SecurityConstraintsFRA_SecurityConstraints
This method does not handle the org.opengis.referencing.ReferenceSystem type, because AFNOR requires to specify whether the system is direct or indirect. For reference system types, use toAFNOR(org.opengis.referencing.ReferenceSystem,boolean) instead.

Parameters:
metadata The metadata to make AFNOR-compliant, or null.
Returns:
A copy of the metadata as an AFNOR-compliant object, or metadata if the metadata was null, does not have an AFNOR type, or was already of the appropriate type.
 
     public static Object toAFNOR(Object metadata) {
         if (metadata != null) {
             if (metadata instanceof org.opengis.metadata.identification.DataIdentification) {
                 if (!(metadata instanceof DataIdentification)) {
                     metadata = new DataIdentification((org.opengis.metadata.identification.DataIdentificationmetadata);
                 }
             } else if (metadata instanceof org.opengis.metadata.constraint.Constraints) {
                 if (metadata instanceof org.opengis.metadata.constraint.LegalConstraints) {
                     if (!(metadata instanceof LegalConstraints)) {
                         metadata = new LegalConstraints((org.opengis.metadata.constraint.LegalConstraintsmetadata);
                     }
                 } else if (metadata instanceof org.opengis.metadata.constraint.SecurityConstraints) {
                     if (!(metadata instanceof SecurityConstraints)) {
                         metadata = new SecurityConstraints((org.opengis.metadata.constraint.SecurityConstraintsmetadata);
                     }
                 } else {
                     if (!(metadata instanceof Constraints)) {
                         metadata = new Constraints((org.opengis.metadata.constraint.Constraintsmetadata);
                     }
                 }
             }
         }
         return metadata;
     }

    
Returns the given given reference system as an AFNOR-compliant instance. AFNOR requires the reference systems to be either direct or indirect. Those two cases are represented by the following schema fragments:

Direct:

xml <complexType name="FRA_DirectReferenceSystem_Type"> <complexContent> <extension base="{http://www.isotc211.org/2005/gmdMD_ReferenceSystem_Type"/> </complexContent> </complexType> }

Indirect:

xml <complexType name="FRA_IndirectReferenceSystem_Type"> <complexContent> <extension base="{http://www.isotc211.org/2005/gmdMD_ReferenceSystem_Type"/> </complexContent> </complexType> }

Parameters:
rs The reference system to make AFNOR-compliant, or null.
indirect false for FRA_DirectReferenceSystem, or true for FRA_IndirectReferenceSystem.
Returns:
A copy of the given reference system as an AFNOR-compliant object, or rs if the given reference system was null or already of the appropriate type.
    public static ReferenceSystem toAFNOR(ReferenceSystem rsfinal boolean indirect) {
        if (rs != null) {
            if (indirect) {
                if (!(rs instanceof IndirectReferenceSystem)) {
                    rs = new IndirectReferenceSystem(rs);
                }
            } else {
                if (!(rs instanceof DirectReferenceSystem)) {
                    rs = new DirectReferenceSystem(rs);
                }
            }
        }
        return rs;
    }
New to GrepCode? Check out our FAQ X