org.xanot.dtd
Class DtdElement

java.lang.Object
  extended by org.xanot.dtd.DtdElement

public class DtdElement
extends java.lang.Object

Object model of "Element" inside a DTD file.

Author:
Ferdinand Neman (newm4n_at_gmail.com)

Field Summary
static java.lang.String CATEGORY
          Element's Category pattern : ("+ANY+"|"+EMPTY+"|"+CHILDS +"|"+OPTIONS+")
static java.lang.String CHILD
          Child inside element pattern : NAME+GREEDY_MARK
static java.lang.String CHILDS
          Collection of child in element pattern : \(\s*("+ PCDATA + "|"+CHILD+"|"+OPTIONS+")(\s*,\s*("+ PCDATA + "|"+CHILD+"|"+OPTIONS+"))*\s*\)" + GREEDY_MARK
static java.lang.String ELEMENT_PATTERN
          Element's main pattern :
static java.lang.String NAME
          Element name pattern : (\w([\w\-]*\w)*)
static java.lang.String OPTIONS
          Elements options pattern : \(\s*("+PCDATA+"|"+CHILD+")(\s*\|\s*"+CHILD+")+\s*\) + GREEDY_MARK
static java.lang.String PCDATA
          PCDATA pattern : PCDATA
 
Constructor Summary
DtdElement(java.lang.String string)
          Create new instance of DtdElement.
 
Method Summary
 java.lang.String[] extractCategoryOptions(java.lang.String optionCategory)
          Extract category options from string to string array.
 java.lang.Object[] extractCategorySequence(java.lang.String sequence)
          Extract category sequence from a string sequence.
 java.lang.String[] extractWords(java.lang.String sequence)
           
 java.lang.String getCategory()
          Get the element's category
 java.lang.String getElementName()
          Get the element's name.
 boolean isCategoryAny()
          Check wether the category is any.
 boolean isCategoryEmpty()
          Check wether the category is empty.
 boolean isCategoryOptions()
          check wether the category have options.
 boolean isCategorySequence()
          Check wether the category is is sequenced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static java.lang.String NAME
Element name pattern : (\w([\w\-]*\w)*)


PCDATA

public static java.lang.String PCDATA
PCDATA pattern : PCDATA


CHILD

public static java.lang.String CHILD
Child inside element pattern : NAME+GREEDY_MARK


OPTIONS

public static java.lang.String OPTIONS
Elements options pattern : \(\s*("+PCDATA+"|"+CHILD+")(\s*\|\s*"+CHILD+")+\s*\) + GREEDY_MARK


CHILDS

public static java.lang.String CHILDS
Collection of child in element pattern : \(\s*("+ PCDATA + "|"+CHILD+"|"+OPTIONS+")(\s*,\s*("+ PCDATA + "|"+CHILD+"|"+OPTIONS+"))*\s*\)" + GREEDY_MARK


CATEGORY

public static java.lang.String CATEGORY
Element's Category pattern : ("+ANY+"|"+EMPTY+"|"+CHILDS +"|"+OPTIONS+")


ELEMENT_PATTERN

public static java.lang.String ELEMENT_PATTERN
Element's main pattern :

Constructor Detail

DtdElement

public DtdElement(java.lang.String string)
Create new instance of DtdElement.

Parameters:
string - Part of DTD data that is representing the "ELEMENT" part.
Method Detail

getElementName

public java.lang.String getElementName()
Get the element's name.

Returns:
Element name.

getCategory

public java.lang.String getCategory()
Get the element's category

Returns:
Category.

isCategoryAny

public boolean isCategoryAny()
Check wether the category is any.

Returns:
True if the category is any. False if other wise.

isCategoryEmpty

public boolean isCategoryEmpty()
Check wether the category is empty.

Returns:
True if the category is empty. false if other wise.

isCategorySequence

public boolean isCategorySequence()
Check wether the category is is sequenced.

Returns:
true if the category is sequenced. false if otherwise.

isCategoryOptions

public boolean isCategoryOptions()
check wether the category have options.

Returns:
true if the category have options. false if otherwise.

extractCategoryOptions

public java.lang.String[] extractCategoryOptions(java.lang.String optionCategory)
Extract category options from string to string array.

Parameters:
optionCategory - The category options
Returns:
String array.

extractCategorySequence

public java.lang.Object[] extractCategorySequence(java.lang.String sequence)
Extract category sequence from a string sequence.

Parameters:
sequence - Sequence
Returns:
Object array.

extractWords

public java.lang.String[] extractWords(java.lang.String sequence)


Copyright 2006 null. All Rights Reserved.