Class DefaultContentModelElement

java.lang.Object
org.springframework.extensions.surf.extensibility.impl.ModelElementImpl
org.springframework.extensions.surf.extensibility.impl.DefaultContentModelElement
All Implemented Interfaces:
ContentModelElement, ExtensibilityModelElement, ValidatedContentModelElement

public class DefaultContentModelElement extends ModelElementImpl implements ValidatedContentModelElement
  • Constructor Details

    • DefaultContentModelElement

      public DefaultContentModelElement(String id, String directiveName)
  • Method Details

    • parseContent

      public void parseContent()
      Description copied from interface: ValidatedContentModelElement
      Processes the content if required. For example, this might take the content string and parse it into a JSON object (such that plugins can merge into the content
      Specified by:
      parseContent in interface ValidatedContentModelElement
    • getNextContentBufferElement

      public ExtensibilityContent getNextContentBufferElement()
      Description copied from interface: ContentModelElement

      This should be implemented to return the next buffer element to write to. Depending upon the implementation this method could always return the same buffer element. The buffer element in this case should be an object that is and implementation of ExtensibilityContent.

      Specified by:
      getNextContentBufferElement in interface ContentModelElement
      Returns:
      An ExtensibilityContent object to write to.
    • validateContent

      public boolean validateContent()
      Specified by:
      validateContent in interface ValidatedContentModelElement
    • flushContent

      public String flushContent()
      Description copied from interface: ContentModelElement

      Flushes the content of the all the buffer elements

      Specified by:
      flushContent in interface ContentModelElement
      Returns:
      A single String which is the output of all the buffer elements.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ModelElementImpl
    • equals

      public boolean equals(Object obj)

      Overrides the default to loosen the parameters slightly. Two ContentModelElement objects are equal if they both implement the ContentModelElement and have the same "id" attribute. This means that two ContentModelElement instances are still considered equal even if they are not implemented by the same class. This makes searching for content in the content model easier.

      Overrides:
      equals in class ModelElementImpl
    • getType

      public String getType()
      Specified by:
      getType in interface ExtensibilityModelElement