Package net.sourceforge.plantuml.core
Class UmlSource
- java.lang.Object
-
- net.sourceforge.plantuml.core.UmlSource
-
public final class UmlSource extends java.lang.ObjectRepresents the textual source of some diagram. The source should start with a@startfooand end with@endfoo.So the diagram does not have to be a UML one.
-
-
Constructor Summary
Constructors Constructor Description UmlSource(java.util.List<StringLocated> data, boolean checkEndingBackslash)UmlSource(java.util.List<StringLocated> data, boolean checkEndingBackslash, java.util.List<StringLocated> rawSource)Build the source from a text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsIgnoreCase(java.lang.String searched)DiagramTypegetDiagramType()Retrieve the type of the diagram.java.lang.StringgetId()java.lang.StringgetLine(LineLocation n)java.lang.StringgetPlainString()Return the source as a single String with\nas line separator.java.lang.StringgetRawString()DisplaygetTitle()Retrieve the title, if defined in the diagram source.intgetTotalLineCount()Return the number of line in the diagram.booleangetTotalLineCountLessThan5()booleanisEmpty()Check if a source diagram description is empty.booleanisStartDef()IteratorCounter2iterator2()Allows to iterator over the source.UmlSourceremoveInitialSkinparam()longseed()
-
-
-
Constructor Detail
-
UmlSource
public UmlSource(java.util.List<StringLocated> data, boolean checkEndingBackslash)
-
UmlSource
public UmlSource(java.util.List<StringLocated> data, boolean checkEndingBackslash, java.util.List<StringLocated> rawSource)
Build the source from a text.- Parameters:
data- the source of the diagramcheckEndingBackslash-trueif an ending backslash means that a line has to be collapsed with the following one.
-
-
Method Detail
-
removeInitialSkinparam
public UmlSource removeInitialSkinparam()
-
containsIgnoreCase
public boolean containsIgnoreCase(java.lang.String searched)
-
getDiagramType
public DiagramType getDiagramType()
Retrieve the type of the diagram. This is based on the first line@startfoo.- Returns:
- the type of the diagram.
-
iterator2
public IteratorCounter2 iterator2()
Allows to iterator over the source.- Returns:
- a iterator that allow counting line number.
-
getPlainString
public java.lang.String getPlainString()
Return the source as a single String with\nas line separator.- Returns:
- the whole diagram source
-
getRawString
public java.lang.String getRawString()
-
seed
public long seed()
-
getLine
public java.lang.String getLine(LineLocation n)
-
getTotalLineCount
public int getTotalLineCount()
Return the number of line in the diagram.- Returns:
-
getTotalLineCountLessThan5
public boolean getTotalLineCountLessThan5()
-
isEmpty
public boolean isEmpty()
Check if a source diagram description is empty. Does not take comment line into account.- Returns:
trueif the diagram does not contain information.
-
getTitle
public Display getTitle()
Retrieve the title, if defined in the diagram source. Never returnnull.- Returns:
-
isStartDef
public boolean isStartDef()
-
getId
public java.lang.String getId()
-
-