SAP NetWeaver '04

com.sapportals.wcm.repository
Class Selector

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.framework_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.repository.Selector

public final class Selector
extends java.lang.Object

Copyright SAP AG 2004

Since:
EP5, SP6, Patch1, Hotfix1; EP6, SP2_CP Selector allows to specify hierarchical queries to define which set of resources should be retrieved from the repository framework. A selector might hold a list of other selector instances as well as PropertySelectorItem instances. Its type constants define how selection instances are combined.

Field Summary
static com.sapportals.wcm.repository.Selector.Type SELECTOR_AND
           
static com.sapportals.wcm.repository.Selector.Type SELECTOR_OR
           
static int SELECTOR_TYPE_AND
           
static int SELECTOR_TYPE_OR
           
 
Constructor Summary
Selector()
          standard constructor - will create a new class instance with selectortype SELECTOR_AND.
Selector(com.sapportals.wcm.repository.Selector.Type type)
          creates a new class instance with the specified selectortype.
 
Method Summary
 void addSelector(boolean include, IProperty property)
          creates a new PropertySelectorItem using the specified parameters
 void addSelector(PropertySelectorItem selector)
           
 void addSelector(Selector selector)
           
 boolean check(IPropertyMap properties)
          checks, if the provided map of properties will pass all PropertySelectorItem instances defined within this class.
 PropertyNameList getPropertyNameList()
           
 com.sapportals.wcm.repository.Selector.Type getSelectorType()
           
 boolean isEmpty()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SELECTOR_TYPE_AND

public static final int SELECTOR_TYPE_AND

SELECTOR_TYPE_OR

public static final int SELECTOR_TYPE_OR

SELECTOR_AND

public static final com.sapportals.wcm.repository.Selector.Type SELECTOR_AND

SELECTOR_OR

public static final com.sapportals.wcm.repository.Selector.Type SELECTOR_OR
Constructor Detail

Selector

public Selector(com.sapportals.wcm.repository.Selector.Type type)
creates a new class instance with the specified selectortype.
Parameters:
type. - If the type is null, the default selectortype SELECTOR_AND will be used

Selector

public Selector()
standard constructor - will create a new class instance with selectortype SELECTOR_AND.
Method Detail

addSelector

public void addSelector(boolean include,
                        IProperty property)
creates a new PropertySelectorItem using the specified parameters
Parameters:
include - the include mode for the PropertySelectorItem
property - the property for the PropertySelectorItem - must not be null

addSelector

public void addSelector(PropertySelectorItem selector)
Parameters:
selector - is added to the list of selectors - must not be null

addSelector

public void addSelector(Selector selector)
Parameters:
selector - is added to the list of selectors - must not be null

getSelectorType

public com.sapportals.wcm.repository.Selector.Type getSelectorType()

isEmpty

public boolean isEmpty()
Returns:
flag, stating, if any Selector or PropertySelectorItem has been added to this class. If not, the method will return true.

getPropertyNameList

public PropertyNameList getPropertyNameList()
Returns:
a list containing all the names of the properties that are used within the PropertySelectorItem instances that have been added to this instance. Also the Property names of PropertySelectorItem instances that are included in the Selector instances added to this instance are added. The current implmentation does not check for duplicates within the list.
Might return an empty list, but never null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

check

public boolean check(IPropertyMap properties)
              throws ResourceException
checks, if the provided map of properties will pass all PropertySelectorItem instances defined within this class. Depending on the combination of these instances and other Selector instances within this class, not all tests will be executed to calculate the result of this method. If, for example, already the first test fails and the Selector.Type of this class is set to SELECTOR_AND, the method will return false without evaluating further properties
Parameters:
properties - the properties to check, must not be null, but might be empty
Returns:
flag, stating if the properties passed this check or not
Throws:
ResourceException -  

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.