org.geotoolkit.xml
Interface NilObject


public interface NilObject

A marker interface for empty XML elements. Note that an "nil" XML element may not be an empty Java object, since the Java object can still be associated with XLink or NilReason attributes. Those attributes are not part of ISO 19115, but may appear in ISO 19139 XML documents like below:

Non-empty Series element Empty Series element
<gmd:CI_Citation>
  <gmd:series>
    <gmd:CI_Series>
      <!-- Some content here -->
    </gmd:CI_Series>
  </gmd:series>
</gmd:CI_Citation>
<gmd:CI_Citation>
  <gmd:series nilReason="unknown"/>
</gmd:CI_Citation>
The reason why an object is empty can be obtained by the getNilReason() method.


Instantiation
The following example instantiates a Citation object which is empty because the information are missing:

Citation nil = NilReason.MISSING.createNilObject(Citation.class);

Since:
3.18
Version:
3.18
Author:
Martin Desruisseaux (Geomatys)
See Also:
NilReason.createNilObject(Class), ObjectLinker.resolve(Class, NilReason)
Module:
utility/geotk-xml-base (download)    View source code for this class

Method Summary
 NilReason getNilReason()
          Returns the reason why this object is empty.
 

Method Detail

getNilReason

NilReason getNilReason()
Returns the reason why this object is empty.

Returns:
The reason why this object is empty.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.