Class XmlColourFactory

java.lang.Object
xml.factories.attribute.XmlFactoryFromAttribute<Colour>
xml.factories.attribute.XmlColourFactory

public class XmlColourFactory
extends XmlFactoryFromAttribute<Colour>
Constructs Colours from XML attributes.
  • Constructor Summary

    Constructors
    Constructor Description
    XmlColourFactory()  
  • Method Summary

    Modifier and Type Method Description
    protected Colour create​(java.lang.String attribute)
    Constructs a new Colour from an XML attribute string.

    Methods inherited from class xml.factories.attribute.XmlFactoryFromAttribute

    create, create

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XmlColourFactory

      public XmlColourFactory()
  • Method Details

    • create

      protected Colour create​(java.lang.String attribute)
      Constructs a new Colour from an XML attribute string.
      Specified by:
      create in class XmlFactoryFromAttribute<Colour>
      Parameters:
      attribute - The XML attribute, in the form "r g b" where r, g, and b are integers between 0 and 255 representing the red, green, and blue values.
      Returns:
      A new colour with the given values.
      Throws:
      XmlParserException - if the input string was malformed.