Gridarta Editor
net.sf.gridarta.model.match.GameObjectMatcherParser Class Reference

Class for some default GameObjectMatchers. More...

+ Collaboration diagram for net.sf.gridarta.model.match.GameObjectMatcherParser:

Static Public Member Functions

static NamedGameObjectMatcher parseMatcher (@NotNull final Element el, final int editType) throws ParsingException
 Creates a NamedGameObjectMatcher from XML. More...
 

Private Member Functions

 GameObjectMatcherParser ()
 Private constructor to prevent instantiation. More...
 

Static Private Member Functions

static GameObjectMatcher createAndMatcher (@NotNull final Node el) throws ParsingException
 Creates an AndGameObjectMatcher. More...
 
static GameObjectMatcher createAttributeArchObjectMatcher (@NotNull final Element el) throws ParsingException
 Creates an AttributeGameObjectMatcher. More...
 
static GameObjectMatcher createMatcher (@NotNull final Element el) throws ParsingException
 Creates a GameObjectMatcher from XML. More...
 
static GameObjectMatcher createOrMatcher (@NotNull final Node el) throws ParsingException
 Creates an OrGameObjectMatcher. More...
 
static GameObjectMatcher createTypeNrsArchObjectMatcher (@NotNull final Element el) throws ParsingException
 Creates a TypeNrsGameObjectMatcher. More...
 
static Collection< GameObjectMatchergetChildMatchers (@NotNull final Node el) throws ParsingException
 Gets the matchers that are found as children of an XML element. More...
 
static String getLanguageTitle (@NotNull final Node el, @NotNull final String language)
 Returns the title for a given language. More...
 
static Node xpathEvaluate (@NotNull final Node el, @NotNull final String xpathExpression)
 Evaluates an XPath expression and returns the result Node. More...
 

Static Private Attributes

static final String XML_ATTRIB_ATTRIBUTE_NAME = "name"
 The name of the "name" attribute within XML_ELEMENT_ATTRIB elements. More...
 
static final String XML_ATTRIB_ATTRIBUTE_OP = "op"
 The name of the "op" attribute within XML_ELEMENT_ATTRIB elements. More...
 
static final String XML_ATTRIB_ATTRIBUTE_TYPE = "type"
 The name of the "type" attribute within XML_ELEMENT_ATTRIB elements. More...
 
static final String XML_ATTRIB_ATTRIBUTE_USEARCHETYPE = "useArchetype"
 The name of the "useArchetype" attribute within XML_ELEMENT_ATTRIB elements. More...
 
static final String XML_ATTRIB_ATTRIBUTE_VALUE = "value"
 The name of the "value" attribute within XML_ELEMENT_ATTRIB elements. More...
 
static final String XML_ELEMENT_AND = "And"
 The name of the "And" element. More...
 
static final String XML_ELEMENT_ATTRIB = "Attrib"
 The name of the "Attrib" element. More...
 
static final String XML_ELEMENT_OR = "Or"
 The name of the "Or" element. More...
 
static final String XML_ELEMENT_TYPENRS = "TypeNrs"
 The name of the "TypeNrs" element. More...
 
static final String XML_MATCHER_ATTRIBUTE_ID = "id"
 The name of the "id" attribute within matcher elements. More...
 
static final String XML_MATCHER_ATTRIBUTE_SYSTEM = "system"
 The name of the "system" attribute within matcher elements. More...
 
static final String XML_MATCHER_ELEMENT_ENV = "Env"
 The name of the "Env" element within matcher elements. More...
 
static final String XML_TYPENRS_ATTRIBUTE_NUMBERS = "numbers"
 The name of the "numbers" attribute within XML_ELEMENT_TYPENRS elements. More...
 

Detailed Description

Class for some default GameObjectMatchers.

Author
Christian Hujer

Definition at line 37 of file GameObjectMatcherParser.java.

Constructor & Destructor Documentation

◆ GameObjectMatcherParser()

net.sf.gridarta.model.match.GameObjectMatcherParser.GameObjectMatcherParser ( )
private

Private constructor to prevent instantiation.

Definition at line 126 of file GameObjectMatcherParser.java.

Member Function Documentation

◆ createAndMatcher()

static GameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.createAndMatcher ( @NotNull final Node  el) throws ParsingException
staticprivate

Creates an AndGameObjectMatcher.

Parameters
el

Definition at line 211 of file GameObjectMatcherParser.java.

References net.sf.gridarta.model.match.GameObjectMatcherParser.getChildMatchers().

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAttributeArchObjectMatcher()

static GameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.createAttributeArchObjectMatcher ( @NotNull final Element  el) throws ParsingException
staticprivate

Creates an AttributeGameObjectMatcher.

Parameters
el

Definition at line 254 of file GameObjectMatcherParser.java.

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher().

+ Here is the caller graph for this function:

◆ createMatcher()

static GameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher ( @NotNull final Element  el) throws ParsingException
staticprivate

◆ createOrMatcher()

static GameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.createOrMatcher ( @NotNull final Node  el) throws ParsingException
staticprivate

Creates an OrGameObjectMatcher.

Parameters
el

Definition at line 222 of file GameObjectMatcherParser.java.

References net.sf.gridarta.model.match.GameObjectMatcherParser.getChildMatchers().

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTypeNrsArchObjectMatcher()

static GameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.createTypeNrsArchObjectMatcher ( @NotNull final Element  el) throws ParsingException
staticprivate

Creates a TypeNrsGameObjectMatcher.

Parameters
el

Definition at line 272 of file GameObjectMatcherParser.java.

References net.sf.gridarta.utils.StringUtils.PATTERN_WHITESPACE.

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher().

+ Here is the caller graph for this function:

◆ getChildMatchers()

static Collection<GameObjectMatcher> net.sf.gridarta.model.match.GameObjectMatcherParser.getChildMatchers ( @NotNull final Node  el) throws ParsingException
staticprivate

Gets the matchers that are found as children of an XML element.

If the children are GameObjectMatchers that have child matchers themselves, their elements are scanned recursively.

Parameters
elthe XML element to look for children
Returns
a
Collection
with
GameObjectMatcher
s that are the children of
el
Exceptions
ParsingExceptionif a parsing error occurs

Definition at line 236 of file GameObjectMatcherParser.java.

References net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher().

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.createAndMatcher(), and net.sf.gridarta.model.match.GameObjectMatcherParser.createOrMatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLanguageTitle()

static String net.sf.gridarta.model.match.GameObjectMatcherParser.getLanguageTitle ( @NotNull final Node  el,
@NotNull final String  language 
)
staticprivate

Returns the title for a given language.

Parameters
elthe element to search
languagethe language to look up
Returns
the title

Definition at line 176 of file GameObjectMatcherParser.java.

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.parseMatcher().

+ Here is the caller graph for this function:

◆ parseMatcher()

static NamedGameObjectMatcher net.sf.gridarta.model.match.GameObjectMatcherParser.parseMatcher ( @NotNull final Element  el,
final int  editType 
) throws ParsingException
static

Creates a NamedGameObjectMatcher from XML.

Parameters
elthe XML node to create from
editTypethe edit type for the new matcher
Returns
the created matcher
Exceptions
ParsingExceptionif a parsing error occurs

Definition at line 137 of file GameObjectMatcherParser.java.

References net.sf.gridarta.model.match.GameObjectMatcherParser.createMatcher(), net.sf.gridarta.model.match.GameObjectMatcherParser.getLanguageTitle(), and net.sf.gridarta.model.match.GameObjectMatcherParser.xpathEvaluate().

Referenced by net.sf.gridarta.model.match.GameObjectMatchersParser.readGameObjectMatchers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xpathEvaluate()

static Node net.sf.gridarta.model.match.GameObjectMatcherParser.xpathEvaluate ( @NotNull final Node  el,
@NotNull final String  xpathExpression 
)
staticprivate

Evaluates an XPath expression and returns the result Node.

Parameters
elthe element to evaluate against
xpathExpressionthe XPath expression to evaluate
Returns
the result node

Definition at line 294 of file GameObjectMatcherParser.java.

Referenced by net.sf.gridarta.model.match.GameObjectMatcherParser.parseMatcher().

+ Here is the caller graph for this function:

Member Data Documentation

◆ XML_ATTRIB_ATTRIBUTE_NAME

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ATTRIB_ATTRIBUTE_NAME = "name"
staticprivate

The name of the "name" attribute within XML_ELEMENT_ATTRIB elements.

Definition at line 44 of file GameObjectMatcherParser.java.

◆ XML_ATTRIB_ATTRIBUTE_OP

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ATTRIB_ATTRIBUTE_OP = "op"
staticprivate

The name of the "op" attribute within XML_ELEMENT_ATTRIB elements.

Definition at line 51 of file GameObjectMatcherParser.java.

◆ XML_ATTRIB_ATTRIBUTE_TYPE

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ATTRIB_ATTRIBUTE_TYPE = "type"
staticprivate

The name of the "type" attribute within XML_ELEMENT_ATTRIB elements.

Definition at line 58 of file GameObjectMatcherParser.java.

◆ XML_ATTRIB_ATTRIBUTE_USEARCHETYPE

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ATTRIB_ATTRIBUTE_USEARCHETYPE = "useArchetype"
staticprivate

The name of the "useArchetype" attribute within XML_ELEMENT_ATTRIB elements.

Definition at line 72 of file GameObjectMatcherParser.java.

◆ XML_ATTRIB_ATTRIBUTE_VALUE

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ATTRIB_ATTRIBUTE_VALUE = "value"
staticprivate

The name of the "value" attribute within XML_ELEMENT_ATTRIB elements.

Definition at line 65 of file GameObjectMatcherParser.java.

◆ XML_ELEMENT_AND

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ELEMENT_AND = "And"
staticprivate

The name of the "And" element.

Definition at line 114 of file GameObjectMatcherParser.java.

◆ XML_ELEMENT_ATTRIB

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ELEMENT_ATTRIB = "Attrib"
staticprivate

The name of the "Attrib" element.

Definition at line 102 of file GameObjectMatcherParser.java.

◆ XML_ELEMENT_OR

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ELEMENT_OR = "Or"
staticprivate

The name of the "Or" element.

Definition at line 108 of file GameObjectMatcherParser.java.

◆ XML_ELEMENT_TYPENRS

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_ELEMENT_TYPENRS = "TypeNrs"
staticprivate

The name of the "TypeNrs" element.

Definition at line 96 of file GameObjectMatcherParser.java.

◆ XML_MATCHER_ATTRIBUTE_ID

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_MATCHER_ATTRIBUTE_ID = "id"
staticprivate

The name of the "id" attribute within matcher elements.

Definition at line 78 of file GameObjectMatcherParser.java.

◆ XML_MATCHER_ATTRIBUTE_SYSTEM

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_MATCHER_ATTRIBUTE_SYSTEM = "system"
staticprivate

The name of the "system" attribute within matcher elements.

Definition at line 84 of file GameObjectMatcherParser.java.

◆ XML_MATCHER_ELEMENT_ENV

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_MATCHER_ELEMENT_ENV = "Env"
staticprivate

The name of the "Env" element within matcher elements.

Definition at line 90 of file GameObjectMatcherParser.java.

◆ XML_TYPENRS_ATTRIBUTE_NUMBERS

final String net.sf.gridarta.model.match.GameObjectMatcherParser.XML_TYPENRS_ATTRIBUTE_NUMBERS = "numbers"
staticprivate

The name of the "numbers" attribute within XML_ELEMENT_TYPENRS elements.

Definition at line 121 of file GameObjectMatcherParser.java.


The documentation for this class was generated from the following file: