Package org.omegat.util.xml
Class XMLBlock
- java.lang.Object
-
- org.omegat.util.xml.XMLBlock
-
public class XMLBlock extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description XMLBlock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLAttributegetAttribute(int n)java.lang.StringgetAttribute(java.lang.String name)java.lang.StringgetShortcut()intgetShortcutNumber()What's the shortcut number of this tag.java.lang.StringgetTagName()java.lang.StringgetText()Returns the block as text - either raw text if not a tag, or the tag and attributes in text form if it isbooleanhasText()Whether this block is a chunk of text (not a tag).booleanisClose()Whether this is a closing tag.booleanisComment()Whether this block is a comment.booleanisStandalone()Whether this block is a standalone tag.booleanisTag()Whether this block is a tag.intnumAttributes()voidsetAttribute(java.lang.String attribute, java.lang.String value)voidsetCloseFlag()Sets that this block is a closing tag.voidsetComment()voidsetShortcut(java.lang.String shortcut)voidsetShortcutNumber(int shortcutNumber)Sets the shortcut number of this tag.voidsetStandaloneFlag()Sets that this block is a stand-alone tag.voidsetTagName(java.lang.String name)voidsetText(java.lang.String text)voidsetTypeChar(char c)java.lang.StringtoString()Returns a string representation for debugging purposes mainly.
-
-
-
Method Detail
-
setAttribute
public void setAttribute(java.lang.String attribute, java.lang.String value)
-
setText
public void setText(java.lang.String text)
-
setTypeChar
public void setTypeChar(char c)
-
setShortcut
public void setShortcut(java.lang.String shortcut)
-
getShortcut
public java.lang.String getShortcut()
-
setCloseFlag
public void setCloseFlag()
Sets that this block is a closing tag.
-
setStandaloneFlag
public void setStandaloneFlag()
Sets that this block is a stand-alone tag.
-
setComment
public void setComment()
-
setTagName
public void setTagName(java.lang.String name)
-
hasText
public boolean hasText()
Whether this block is a chunk of text (not a tag).
-
isTag
public boolean isTag()
Whether this block is a tag.
-
isStandalone
public boolean isStandalone()
Whether this block is a standalone tag.
-
isClose
public boolean isClose()
Whether this is a closing tag.
-
isComment
public boolean isComment()
Whether this block is a comment.
-
getText
public java.lang.String getText()
Returns the block as text - either raw text if not a tag, or the tag and attributes in text form if it is
-
getTagName
public java.lang.String getTagName()
-
numAttributes
public int numAttributes()
-
getAttribute
public XMLAttribute getAttribute(int n)
-
getAttribute
public java.lang.String getAttribute(java.lang.String name)
-
toString
public java.lang.String toString()
Returns a string representation for debugging purposes mainly.- Overrides:
toStringin classjava.lang.Object
-
getShortcutNumber
public int getShortcutNumber()
What's the shortcut number of this tag.
-
setShortcutNumber
public void setShortcutNumber(int shortcutNumber)
Sets the shortcut number of this tag.
-
-