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
-
Field Summary
Fields inherited from interface org.springframework.extensions.surf.extensibility.ContentModelElement
TYPE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.extensions.surf.extensibility.impl.ModelElementImpl
getDirectiveName, getId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.extensions.surf.extensibility.ExtensibilityModelElement
getDirectiveName, getId
-
Constructor Details
-
DefaultContentModelElement
-
-
Method Details
-
parseContent
public void parseContent()Description copied from interface:ValidatedContentModelElementProcesses 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:
parseContentin interfaceValidatedContentModelElement
-
getNextContentBufferElement
Description copied from interface:ContentModelElementThis 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:
getNextContentBufferElementin interfaceContentModelElement- Returns:
- An
ExtensibilityContentobject to write to.
-
validateContent
public boolean validateContent()- Specified by:
validateContentin interfaceValidatedContentModelElement
-
flushContent
Description copied from interface:ContentModelElementFlushes the content of the all the buffer elements
- Specified by:
flushContentin interfaceContentModelElement- Returns:
- A single String which is the output of all the buffer elements.
-
hashCode
public int hashCode()- Overrides:
hashCodein classModelElementImpl
-
equals
Overrides the default to loosen the parameters slightly. Two
ContentModelElementobjects are equal if they both implement theContentModelElementand have the same "id" attribute. This means that twoContentModelElementinstances 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:
equalsin classModelElementImpl
-
getType
- Specified by:
getTypein interfaceExtensibilityModelElement
-