org.activemath.omdocjdom
Class OJItem

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by org.activemath.omdocjdom.OJElement
              extended by org.activemath.omdocjdom.OJItem
All Implemented Interfaces:
Serializable, Cloneable, Infoable, OJNode, org.jdom.Parent
Direct Known Subclasses:
MBaseItem

public class OJItem
extends OJElement

This class implements a default behaviour for an OJItem which supposes a complete OMdoc is loaded as parent of the item.

An item, in ActiveMath parlance is one of the elementary pieces of content-reordering for presentation planning: these are definitions, symbol, axioms, assertions, omtexts, exercises, examples. Their list is described in the OJConstants.ITEM_NAMES constant.

As with any subclass of Element, we have to provide all five constructors though most would be useless.

This class should particularly support accessing ActiveMath related values as well as metadata values. A first attempt is made here, more is to come.

Version:
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.activemath.omdocjdom.OJElement
DEBUG, id, info, log
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
protected OJItem()
           
  OJItem(String name)
           
  OJItem(String name, org.jdom.Namespace namespace)
           
 
Method Summary
 List getCMPs(String preferredLanguage)
          Returns the list of all the CMPs that have the given language, if they exist.
 List getFMPs()
          Returns the list of FMPs children.
 String getForWhat()
          Returns the attribute for contained in the element.
 List getOccurrences()
          Returns the list of all the OMS and ref descendant of this element.
 
Methods inherited from class org.activemath.omdocjdom.OJElement
addContentMaybeCloning, addContentMaybeCloning, addContentMaybeCloning, addContentMaybeCloning, addContentMaybeCloning, addDCmetadata, addProperlyIndented, addProperlyIndented, clearExtraNamespaces, findChildWithID, getAnyTitle, getAnyTitle, getChildrenRefs, getCompleteDCMetadata, getContainingItem, getContainingTheory, getContainingTheoryIDstring, getCreator, getEnclosingID, getFirstDCMetadata, getID, getIndentOfElementWithNL, getInfo, getLanguage, getNL, getOrMakeMetadata, getorMakeMetadataExtradata, getParentOJElement, getRealContent, getTitle, getTitleMap, getTitleMapAsJdomElts, getTitleMapAsJdomNodeList, getTitleMapAsXmlString, getUnionOfDCMetadataEntries, listItems, setID, setID, setInfo, setNamespace, toString
 
Methods inherited from class org.jdom.Element
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContent, setContent, setContent, setContent, setName, setText
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.activemath.omdocjdom.OJNode
getDocument, getParent
 
Methods inherited from interface org.jdom.Parent
getDocument, getParent
 

Constructor Detail

OJItem

protected OJItem()

OJItem

public OJItem(String name)

OJItem

public OJItem(String name,
              org.jdom.Namespace namespace)
Method Detail

getOccurrences

public List getOccurrences()
Returns the list of all the OMS and ref descendant of this element.


getForWhat

public String getForWhat()
Returns the attribute for contained in the element. The specifications might change making this request to perform another lookup.


getCMPs

public List getCMPs(String preferredLanguage)
Returns the list of all the CMPs that have the given language, if they exist. If they do not, the CMPs that have no language and finally the CMPs of the first language.


getFMPs

public List getFMPs()
Returns the list of FMPs children.