Class planet

java.lang.Object
name.moore.kevin.ze.XMLdata.XMLbase
name.moore.kevin.ze.XMLdata.planet

public class planet extends XMLbase
Process a <planet> XML element into an entity and components.
Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • DEFAULTSPEC

      private static String DEFAULTSPEC
    • spec

      Optional element in XML <spec key="S"></spec>.

      This planets specification eg a class "M" planet - these specs are handled in planetSpec. This field contains a String reference to the spec, not it's actual EntityId so we need to do a lookup via getEntityReference()

      If this isn't specified then it is defaulted to "U" - unclassified.

      See Also:
      planetSpec, spec
    • orbiting

      @ZodiacEntityReference @XStreamConverter(value=AttributedValueReferenceConverter.class, strings="value") private reference orbiting
      Required element in XML <orbiting key="Sol">3</orbiting>.

      This is a String reference to another entity to be in orbit around. It will need to be resolved to a real entity via the entityFactory

      See Also:
      name.moore.kevin.ze.entities.entityFactory#makeEntity(name.moore.kevin.ze.XMLdata.XMLbase)
  • Constructor Details

    • planet

      public planet()
  • Method Details

    • getSpec

      public reference getSpec()
      Description copied from class: XMLbase
      Derived classes override if they really do want to return a spec reference.
      Overrides:
      getSpec in class XMLbase
      Returns:
    • getOrbiting

      public reference getOrbiting()
      Returns:
    • readResolve

      protected Object readResolve()
      Description copied from class: XMLbase
      Called automatically when loading from XML as part of JDK serialisation.

      Used to do some validation of that incoming XML by asserting that properties are set and have defaults as required. Output warning messages if a default is applied. Output error messages if a required XML element is missing and return null to indicate an invalid object.

      Overrides:
      readResolve in class XMLbase
      Returns:
      null if we can't create a valid object
    • getEntityClass

      public Class getEntityClass()
      Description copied from class: XMLbase
      Derived classes have to override this and say what class eg engine.class they are. This allows us to use this base class but discover the derived class.
      Specified by:
      getEntityClass in class XMLbase
      Returns: