com.guiseframework.theme
Class Rule

java.lang.Object
  extended by com.globalmentor.collections.ReadWriteLockDecorator
      extended by com.globalmentor.urf.AbstractURFScope
          extended by com.globalmentor.urf.DefaultURFResource
              extended by com.globalmentor.urf.AbstractClassTypedURFResource
                  extended by com.guiseframework.theme.Rule
All Implemented Interfaces:
com.globalmentor.net.Resource, com.globalmentor.urf.URFResource, com.globalmentor.urf.URFScope, java.util.concurrent.locks.ReadWriteLock

public class Rule
extends com.globalmentor.urf.AbstractClassTypedURFResource

A rule for specifying part of a theme.

Author:
Garret Wilson

Field Summary
 
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
 
Constructor Summary
Rule()
          Default constructor.
Rule(java.net.URI referenceURI)
          Reference URI constructor.
 
Method Summary
 boolean apply(java.lang.Object object, com.globalmentor.urf.ploop.PLOOPURFProcessor ploopProcessor)
          Applies this rule to the given object.
 Template getApply()
           
 com.globalmentor.urf.select.Selector getSelector()
          Return this rule's selector, or null if this rule has no selector property or the value is not a Selector.
 void setApply(Template apply)
          Sets this rule's apply declaration.
 void setSelector(com.globalmentor.urf.select.Selector selector)
          Sets this rule's selector.
 
Methods inherited from class com.globalmentor.urf.DefaultURFResource
addType, addTypeURI, alter, determineLabel, equals, getLabel, getName, getType, getTypes, getTypeURI, getURI, hashCode, hasTypeURI, setLabel, setName, setURI, toString
 
Methods inherited from class com.globalmentor.urf.AbstractURFScope
addAllProperties, addProperty, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, getCreationOrder, getNamespaceProperties, getOrder, getParentScope, getProperties, getProperties, getPropertyCount, getPropertyURIs, getPropertyValue, getPropertyValueContext, getPropertyValueContext, getPropertyValueContexts, getPropertyValueCount, getPropertyValueCount, getPropertyValues, getPropertyValues, getPropertyValueURI, getScope, hasNamespaceProperty, hasProperties, hasProperty, hasProperty, hasPropertyValue, hasPropertyValueURI, removeNamespacePropertyValues, removeProperties, removeProperty, removePropertyValue, removePropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setProperty, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
 
Methods inherited from class com.globalmentor.collections.ReadWriteLockDecorator
readLock, writeLock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.globalmentor.urf.URFScope
addAllProperties, addProperty, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, getCreationOrder, getNamespaceProperties, getOrder, getParentScope, getProperties, getProperties, getPropertyCount, getPropertyURIs, getPropertyValue, getPropertyValueContext, getPropertyValueContext, getPropertyValueContexts, getPropertyValueCount, getPropertyValueCount, getPropertyValues, getPropertyValues, getPropertyValueURI, getScope, hasNamespaceProperty, hasProperties, hasProperty, hasProperty, hasPropertyValue, hasPropertyValueURI, removeNamespacePropertyValues, removeProperties, removeProperty, removePropertyValue, removePropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setOrderedPropertyValues, setProperty, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues
 
Methods inherited from interface java.util.concurrent.locks.ReadWriteLock
readLock, writeLock
 

Constructor Detail

Rule

public Rule()
Default constructor.


Rule

public Rule(java.net.URI referenceURI)
Reference URI constructor.

Parameters:
referenceURI - The reference URI for the new resource.
Method Detail

getSelector

public com.globalmentor.urf.select.Selector getSelector()
Return this rule's selector, or null if this rule has no selector property or the value is not a Selector.

Returns:
This rule's selector, or null if this rule has no selector property or the value is not a Selector.
See Also:
Select.SELECTOR_PROPERTY_URI

setSelector

public void setSelector(com.globalmentor.urf.select.Selector selector)
Sets this rule's selector.

Parameters:
selector - This rule's selector, or null if this rule should have no selector property.

getApply

public Template getApply()
Returns:
This rule's apply declaration, or null if this rule has no theme.apply selector or the value is not a Template.

setApply

public void setApply(Template apply)
Sets this rule's apply declaration.

Parameters:
apply - This rule's apply declaration, or null if this rule should have no apply declaration.

apply

public boolean apply(java.lang.Object object,
                     com.globalmentor.urf.ploop.PLOOPURFProcessor ploopProcessor)
              throws com.globalmentor.util.DataException,
                     java.lang.reflect.InvocationTargetException
Applies this rule to the given object. Providing a PLOOP processor allows consistency of referenced values across rule applications.

Parameters:
object - The object on which this rule should be applied.
ploopProcessor - The PLOOP processor for setting object properties.
Returns:
true if the rule selected the given object.
Throws:
java.lang.NullPointerException - if the given object and/or PLOOP processor is null.
com.globalmentor.util.DataException - if a resource is a Java-typed resource the class of which cannot be found.
com.globalmentor.util.DataException - if a particular value is not an appropriate argument for the corresponding property.
com.globalmentor.util.DataException - If a particular property could not be accessed.
java.lang.reflect.InvocationTargetException - if a resource indicates a Java class the constructor of which throws an exception.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.