class Document extends NarrativeElement with ContainerElement[NarrativeElement] with DefaultMutability[NarrativeElement]
A Document represents an MMT document.
A document is stored as a list of references (XRef) to content items. The content itself is stored in the controller.
- Source
- Document.scala
- Alphabetic
- By Inheritance
- Document
- DefaultMutability
- ContainerElement
- MutableElementContainer
- ElementContainer
- NarrativeElement
- StructuralElement
- NamedElement
- Content
- ClientProperties
- HasMetaData
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Document(path: DPath, level: DocumentLevel = FileLevel, contentAncestor: Option[ModuleOrLink] = None, inititems: List[NarrativeElement] = Nil, initNsMap: NamespaceMap = NamespaceMap.empty)
- path
the URI of the document; for toplevel documents, this is a URL
- level
the role of this document in a hierarchy of nested documents, default is FileLevel the role of source files containing modules
- contentAncestor
the closest container of this document that is a module (if any)
- initNsMap
the namespace map that applies at the beginning of the document
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
add(i: NarrativeElement, at: AddPosition = AtEnd): Unit
- Definition Classes
- DefaultMutability
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
lazy val
clientProperty: ListMap[URI, Any]
- Definition Classes
- ClientProperties
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compatible(that: StructuralElement): Boolean
two StructuralElement's are compatible if they have the same type, same Path, and agree in all parts that are TermContainer's
two StructuralElement's are compatible if they have the same type, same Path, and agree in all parts that are TermContainer's
- Definition Classes
- StructuralElement
- val contentAncestor: Option[ModuleOrLink]
-
def
delete(n: LocalName): Option[NarrativeElement]
deletes a child
deletes a child
- Definition Classes
- DefaultMutability
-
def
domain: Iterable[LocalName]
- Definition Classes
- Document → ElementContainer
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
equivalentTo(that: StructuralElement): Boolean
logically equivalent: compares headerInfo, components, and declarations
logically equivalent: compares headerInfo, components, and declarations
- Definition Classes
- StructuralElement
-
val
feature: String
the kind of declaration, e.g., "constant"
the kind of declaration, e.g., "constant"
- Definition Classes
- Document → StructuralElement
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(name: LocalName): NarrativeElement
- Definition Classes
- ElementContainer
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getComponent(k: ComponentKey): Option[ComponentContainer]
returns a specific component if present
returns a specific component if present
- Definition Classes
- StructuralElement
-
def
getComponentContext(k: ComponentKey): Context
like getComponent but returns the additional context (in addition to the context of the element) of the component, empty by default, override as needed unspecified if the component does not exist
like getComponent but returns the additional context (in addition to the context of the element) of the component, empty by default, override as needed unspecified if the component does not exist
- Definition Classes
- StructuralElement
-
def
getComponents: List[DeclarationComponent]
returns all term components of this elements
returns all term components of this elements
- Definition Classes
- NarrativeElement → StructuralElement
-
def
getDeclarations: List[NarrativeElement]
returns the list of children of the document (including narration)
returns the list of children of the document (including narration)
- Definition Classes
- Document → ElementContainer → StructuralElement
-
def
getDeclarationsBefore(n: LocalName): List[NarrativeElement]
- Definition Classes
- ElementContainer
-
def
getDeclarationsElaborated: List[NarrativeElement]
the list of declarations using elaborated declarations where possible these are: primitive elements: includes, constants other elements if they have not been fully elaborated
the list of declarations using elaborated declarations where possible these are: primitive elements: includes, constants other elements if they have not been fully elaborated
- Definition Classes
- ContainerElement
-
def
getIIContext: InterpretationInstructionContext
returns the interpretation contex that applies at the end of this document
-
def
getLocally(name: LocalName): Option[NarrativeElement]
same as get
-
def
getMetaDataNode: NodeSeq
- Definition Classes
- HasMetaData
-
def
getModules(lib: Lookup): List[MPath]
- returns
list of modules declared in this Document or its children (depth first)
-
def
getModulesResolved(lib: Lookup): List[Module]
like getModules but resolves all modules
-
def
getMostSpecific(name: LocalName): Option[(NarrativeElement, LocalName)]
- Definition Classes
- Document → ElementContainer
-
def
getNamespaceMap: NamespaceMap
returns the namespace map that applies at the end of this document
-
def
getO(name: LocalName): Option[NarrativeElement]
retrieves a descendant
retrieves a descendant
This may fail for two reasons:
- a segment of n does not exist
- a segment of n exists but is not a Document
use Library.getNarrative for smarter dereferencing
- Definition Classes
- Document → ElementContainer
-
def
getO(name: String): Option[NarrativeElement]
same as get(LocalName(name))
same as get(LocalName(name))
- Definition Classes
- ElementContainer
-
def
getOrigin: Origin
- Definition Classes
- StructuralElement
-
def
getPrimitiveDeclarations: List[NarrativeElement]
the list of declarations in the order of addition, excludes generated declarations
the list of declarations in the order of addition, excludes generated declarations
- Definition Classes
- ContainerElement
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
headerInfo: HeaderInfo
header information of this elements includes the MMT types (e.g., domain, codomain of links) but not the logical types of constants
header information of this elements includes the MMT types (e.g., domain, codomain of links) but not the logical types of constants
- Definition Classes
- StructuralElement
-
def
isDeclared(name: LocalName): Boolean
- Definition Classes
- ElementContainer
-
def
isGenerated: Boolean
- Definition Classes
- StructuralElement
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val level: DocumentLevel
-
def
merge(that: StructuralElement): Unit
merge all properties of 'that' into 'this' except for components and declarations
merge all properties of 'that' into 'this' except for components and declarations
- Definition Classes
- StructuralElement
-
val
metadata: MetaData
- Definition Classes
- HasMetaData
-
val
name: LocalName
the name relative to the parent
the name relative to the parent
- Definition Classes
- Document → NamedElement
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
parent: DPath
the containing knowledge item, a URL if none
the containing knowledge item, a URL if none
- Definition Classes
- Document → StructuralElement
-
def
parentOpt: Option[DPath]
the containing document if root == false; otherwise, the URI without path
the containing document if root == false; otherwise, the URI without path
- Definition Classes
- Document → NarrativeElement
-
val
path: DPath
the MMT URI of the element
the MMT URI of the element
- Definition Classes
- Document → NarrativeElement → StructuralElement
-
def
reorder(ln: LocalName): Unit
moves ln to the end
moves ln to the end
- Definition Classes
- DefaultMutability
-
def
root: Boolean
not a section (which is stored as part of some other document)
-
def
setDeclarations(nes: List[NarrativeElement]): Unit
must be provided by the implementing class to update the declarations
must be provided by the implementing class to update the declarations
- Attributes
- protected
- Definition Classes
- Document → DefaultMutability
-
def
setOrigin(o: Origin): Unit
- Definition Classes
- StructuralElement
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toNode(rh: RenderingHandler): Unit
by default, this prints out toNode
by default, this prints out toNode
potentially large StructuralElements should override it with a memory-efficient implementation
-
def
toNode: Elem
XML representation
-
def
toNodeResolved(lib: Lookup, expandAll: Boolean = false): Elem
prints document with all generated references expanded
prints document with all generated references expanded
- lib
the library where reference are looked up
- expandAll
whether to expand all references or only generated ones false by default
-
def
toString(): String
- Definition Classes
- Document → AnyRef → Any
-
def
update(s: NarrativeElement): Unit
updates or adds a child
updates or adds a child
- Definition Classes
- DefaultMutability
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()