org.jbind.xml.core.bridge
Interface IImplWithText

All Known Subinterfaces:
IAttributeImpl, IDataImpl, IDomAttr, IDomAttrOrElm, IDomCDataSection, IDomElement, IDomText, IElementImpl, ITextImpl
All Known Implementing Classes:
AttributeImpl, DataImpl, DomAttr, DomAttrOrElm, DomCDataSection, DomElement, DomText, ElementFactoryImpl, ElementFactoryImpl, ElementImpl, StringDataImpl, TextImpl

public interface IImplWithText


Method Summary
 java.lang.String getTextContent()
          Gets the textual content.
 boolean hasTextContent()
          Checks if the implementation has textual content.
 boolean isDefault()
          Checks if the data implementation is a default value or if a value was assigned explicitly.
 void restoreTextContent(ITextContentMemento aMemento)
           
 ITextContentMemento saveTextContent()
           
 void setTextContent(ITextContentProvider aTextContentProvider)
          Sets the textual content by specifiying a provider for lazy evaluation.
 void setTextContent(java.lang.String aValue)
          Sets the textual content.
 

Method Detail

isDefault

public boolean isDefault()
Checks if the data implementation is a default value or if a value was assigned explicitly.

Returns:
Returns true iff the data implementation is a default value.

getTextContent

public java.lang.String getTextContent()
Gets the textual content. The textual content corresponds to the lexical value of a data object. For data implementations of attributes the string that is assigned to the attribute is returned. For data implementations of elements with simple content the string value that is assigned to the simple content is returned. If the simple content is empty then the empty string is returned.

Returns:
(required).

setTextContent

public void setTextContent(java.lang.String aValue)
Sets the textual content. The textual content corresponds to the lexical value of a data object.

Parameters:
aValue - (required).

setTextContent

public void setTextContent(ITextContentProvider aTextContentProvider)
Sets the textual content by specifiying a provider for lazy evaluation.

Parameters:
aTextContentProvider - (required).

hasTextContent

public boolean hasTextContent()
Checks if the implementation has textual content. This method is used to decide if a default value should be used or not.

Attribute implementations will always return true because attributes take their default values only if they are not present in the instance.

Element implementation will return true iff their text content is null or equal to the empty string. In other words the default value of an element is used when the element is empty. (cf. the note at W3C XML-Schema-Structure specification section 3.1.1).

Returns:
Returns true iff there is textual content.

saveTextContent

public ITextContentMemento saveTextContent()

restoreTextContent

public void restoreTextContent(ITextContentMemento aMemento)