OBEROn SDK

com.oberon.ooql.sdk
Class Navigator

java.lang.Object
  extended by com.oberon.ooql.sdk.Navigator

public class Navigator
extends java.lang.Object

Class used to perform ObjectObj navigation throw their Links

Version:
5.0

Field Summary
 java.util.Hashtable<java.lang.String,java.lang.Object> hLnkExpr
           
 java.util.Hashtable<java.lang.String,java.lang.Object> hObjExpr
           
static int LEVEL_ALL
          Explode all levels
static int NAVIGATE_BOTH
          Navigate versus: Both
static int NAVIGATE_FROM
          Navigate versus: From
static int NAVIGATE_TO
          Navigate versus: To
 java.lang.String sLinkTypeFilterIds
           
 
Constructor Summary
Navigator()
           
 
Method Summary
 void addClassPattern(java.lang.String pattern)
          Add a ObjectObj's Class filter pattern.
 void addLinkTypePattern(java.lang.String pattern)
          Add a LinkType filter pattern.
 void addSeparatorToken(java.lang.String token)
          Add a separator token for ObjectObj or Link properties
 java.util.Vector<java.lang.String> getClassPatterns()
          Get the list of ObjectObj's Class filter patterns
 int getLevel()
          Get navigate-expansion level
 java.lang.String getLinkFilter()
          Return the Link filter expression
 Selector getLinkSelector()
          Get the Link selector
 java.util.Vector<java.lang.String> getLinkTypePatterns()
          Get the list of LinkType filter patterns.
 java.lang.String getObjectFilter()
          Return the ObjectObj filter expression
 Selector getObjectSelector()
          Get the ObjectObj selector
 java.lang.String getOOQLTokens()
          Show the selector tokens as OOQL syntax
 java.lang.String getOutputString(org.jdom.Element xml, boolean rootElement)
          Convert the XML data to String Apply JSON transformation if required
 java.lang.String getToken()
          Get the property sepataror token
 int getVersus()
          Get navigate-expansion versus
static java.lang.String getVersusAsString(int versus)
          Convert navigate-expansion versus to string
static int getVersusFromString(java.lang.String versus)
          Convert navigate-expansion versus from string
 boolean isJSON()
          Check if the property navigate result is in JSON format
 boolean isLinkTypeSequence()
          Check if the linktype pattern represents a sequence
 boolean isSkipHidden()
          Check if hidden links are allowed
 boolean isXML()
          Check if the navigate results must be in XML format
 void setJSON(boolean json)
          Set the JSON output format
 void setLevel(int level)
          Set navigate-expansion level
 void setLinkFilter(java.lang.String expression)
          Set the Link filter expression
 void setLinkSelector(Selector selector)
          Set the Link selector to retrieve the Link's properties
 void setLinkTypeSequence(boolean sequence)
          Set the linktype patterns as a sequence instead of an OR-combination
 void setObjectFilter(java.lang.String expression)
          Set the ObjectObj filter expression
 void setObjectSelector(Selector selector)
          Set the ObjectObj selector to retrieve the linked ObjectObj's properties
 void setSkipHidden(boolean skip)
          Set if hidden links must be skipped or not
 void setVersus(int versus)
          Set navigate-expansion versus
 void setXML(boolean xml)
          Set if the navigate results must be in XML format
 java.lang.String toOOQL()
          Return the Navigator as OOQL syntax
 java.lang.String toString()
          Return the Navigator as a single String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAVIGATE_FROM

public static final int NAVIGATE_FROM
Navigate versus: From

See Also:
Constant Field Values

NAVIGATE_TO

public static final int NAVIGATE_TO
Navigate versus: To

See Also:
Constant Field Values

NAVIGATE_BOTH

public static final int NAVIGATE_BOTH
Navigate versus: Both

See Also:
Constant Field Values

LEVEL_ALL

public static final int LEVEL_ALL
Explode all levels

See Also:
Constant Field Values

hObjExpr

public java.util.Hashtable<java.lang.String,java.lang.Object> hObjExpr

hLnkExpr

public java.util.Hashtable<java.lang.String,java.lang.Object> hLnkExpr

sLinkTypeFilterIds

public java.lang.String sLinkTypeFilterIds
Constructor Detail

Navigator

public Navigator()
Method Detail

setLevel

public void setLevel(int level)
Set navigate-expansion level

Parameters:
level - the depth navigation level, default = 1

getLevel

public int getLevel()
Get navigate-expansion level


setVersus

public void setVersus(int versus)
Set navigate-expansion versus

Parameters:
versus - the navigation versus, default = NAVIGATE_BOTH

getVersus

public int getVersus()
Get navigate-expansion versus


getVersusAsString

public static java.lang.String getVersusAsString(int versus)
Convert navigate-expansion versus to string


getVersusFromString

public static int getVersusFromString(java.lang.String versus)
Convert navigate-expansion versus from string

Returns:
one of the VERSUS constant or "NAVIGATE_BOTH" if it is not recognized

addClassPattern

public void addClassPattern(java.lang.String pattern)
Add a ObjectObj's Class filter pattern.

Parameters:
pattern - a pattern to filter ObjectObj's Class types ( can contain wildcards {*?} )

getClassPatterns

public java.util.Vector<java.lang.String> getClassPatterns()
Get the list of ObjectObj's Class filter patterns

Returns:
vector of pattern String

addLinkTypePattern

public void addLinkTypePattern(java.lang.String pattern)
Add a LinkType filter pattern.

Parameters:
pattern - a pattern to filter LinkTypes ( can contain wildcards {*?} )

getLinkTypePatterns

public java.util.Vector<java.lang.String> getLinkTypePatterns()
Get the list of LinkType filter patterns.

Returns:
vector of pattern String

setSkipHidden

public void setSkipHidden(boolean skip)
Set if hidden links must be skipped or not

Parameters:
skip - if false includes also the hidden links in the navigate result

isSkipHidden

public boolean isSkipHidden()
Check if hidden links are allowed


setLinkTypeSequence

public void setLinkTypeSequence(boolean sequence)
Set the linktype patterns as a sequence instead of an OR-combination

Parameters:
sequence - if true, consider the linktype patterns as a sequence: at each level will be applied a different filter strictly related to the linktype order. If the linktype names in the sequence are less than current level number, no filter will be applied for this level and next levels For example: navigator.addLinkTypePattern("LinkTyp?1"); navigator.addLinkTypePattern("Link*2"); navigator.addLinkTypePattern("*Type3"); the "LinkTyp?1" will be used to filter the 1st level, "Link*2" for 2nd level and "*Type3" for the 3rd level; for the next levels (4,5,6,...) all linktypes will be accepted
Since:
3.0

isLinkTypeSequence

public boolean isLinkTypeSequence()
Check if the linktype pattern represents a sequence

Since:
3.0

setObjectSelector

public void setObjectSelector(Selector selector)
Set the ObjectObj selector to retrieve the linked ObjectObj's properties


getObjectSelector

public Selector getObjectSelector()
Get the ObjectObj selector


setLinkSelector

public void setLinkSelector(Selector selector)
Set the Link selector to retrieve the Link's properties


getLinkSelector

public Selector getLinkSelector()
Get the Link selector


setXML

public void setXML(boolean xml)
Set if the navigate results must be in XML format

Parameters:
xml - true to obtain the navigate result as xml format

isXML

public boolean isXML()
Check if the navigate results must be in XML format


setJSON

public void setJSON(boolean json)
Set the JSON output format

Parameters:
json - if true the property navigate result will be in JSON format
Since:
4.2.3

isJSON

public boolean isJSON()
Check if the property navigate result is in JSON format

Since:
4.2.3

addSeparatorToken

public void addSeparatorToken(java.lang.String token)
Add a separator token for ObjectObj or Link properties


getToken

public java.lang.String getToken()
Get the property sepataror token


getOOQLTokens

public java.lang.String getOOQLTokens()
Show the selector tokens as OOQL syntax


setObjectFilter

public void setObjectFilter(java.lang.String expression)
Set the ObjectObj filter expression

Parameters:
expression - the OOQL boolean expression used to filter ObjectObj during the navigation process

getObjectFilter

public java.lang.String getObjectFilter()
Return the ObjectObj filter expression


setLinkFilter

public void setLinkFilter(java.lang.String expression)
Set the Link filter expression

Parameters:
expression - the OOQL boolean expression used to filter Links during the navigation process

getLinkFilter

public java.lang.String getLinkFilter()
Return the Link filter expression


toString

public java.lang.String toString()
Return the Navigator as a single String

Overrides:
toString in class java.lang.Object

toOOQL

public java.lang.String toOOQL()
Return the Navigator as OOQL syntax


getOutputString

public java.lang.String getOutputString(org.jdom.Element xml,
                                        boolean rootElement)
                                 throws OberonException
Convert the XML data to String Apply JSON transformation if required

Throws:
OberonException
Since:
4.2.3

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.