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 Constructor Description DefaultContentModelElement(java.lang.String id, java.lang.String directiveName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Overrides the default to loosen the parameters slightly.java.lang.StringflushContent()Flushes the content of the all the buffer elementsExtensibilityContentgetNextContentBufferElement()This should be implemented to return the next buffer element to write to.java.lang.StringgetType()inthashCode()voidparseContent()Processes the content if required.booleanvalidateContent()-
Methods inherited from class org.springframework.extensions.surf.extensibility.impl.ModelElementImpl
getDirectiveName, getId, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.extensions.surf.extensibility.ExtensibilityModelElement
getDirectiveName, getId
-
-
-
-
Method Detail
-
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
public ExtensibilityContent 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
public java.lang.String 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
public boolean equals(java.lang.Object obj)
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
public java.lang.String getType()
- Specified by:
getTypein interfaceExtensibilityModelElement
-
-