WebObjects 5.4.2

com.webobjects.appserver.parser.woml.namespaces
Class WOMLAbstractNamespace.WOGenericElementRule

java.lang.Object
  extended by com.webobjects.appserver.parser.woml.namespaces.WOMLAbstractNamespace.WOGenericElementRule
Enclosing class:
WOMLAbstractNamespace

public static class WOMLAbstractNamespace.WOGenericElementRule
extends Object


Nested Class Summary
static class WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy
           
 
Field Summary
static WOMLAbstractNamespace.WOGenericElementRule DEFAULT_RULE
           
static NSMutableDictionary RULES
           
 
Constructor Summary
WOMLAbstractNamespace.WOGenericElementRule(String name, NSDictionary ruleDictionary)
           
WOMLAbstractNamespace.WOGenericElementRule(String name, WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy endTagOptionality)
           
 
Method Summary
protected static WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy decodeEndTagPolicy(Object value, WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy defaultValue)
           
static WOMLAbstractNamespace.WOGenericElementRule getGenericElementRule(String elementName)
          Returns the generic element rule for the given element name.
static WOMLAbstractNamespace.WOGenericElementRule getGenericElementRule(WOElement element)
          Returns the generic element rule for the given generic element.
 String getGenericElementType(WOElement element)
          Returns either WOGenericElement or WOGenericContainer, depending on the state of the input element.
 String getName()
          Returns the name to which this rule is associated.
 boolean isContainer(String elementName, boolean hasChildren)
          Convenience API for getGenericElementType that will return true if the represented elementName and hasChildren should be represented by a container tag (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RULES

public static NSMutableDictionary RULES

DEFAULT_RULE

public static WOMLAbstractNamespace.WOGenericElementRule DEFAULT_RULE
Constructor Detail

WOMLAbstractNamespace.WOGenericElementRule

public WOMLAbstractNamespace.WOGenericElementRule(String name,
                                                  NSDictionary ruleDictionary)

WOMLAbstractNamespace.WOGenericElementRule

public WOMLAbstractNamespace.WOGenericElementRule(String name,
                                                  WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy endTagOptionality)
Method Detail

decodeEndTagPolicy

protected static WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy decodeEndTagPolicy(Object value,
                                                                                            WOMLAbstractNamespace.WOGenericElementRule.EndTagPolicy defaultValue)

getGenericElementRule

public static WOMLAbstractNamespace.WOGenericElementRule getGenericElementRule(WOElement element)
Returns the generic element rule for the given generic element. If the parameter is not a WOGenericElement this will return the default rule.

Parameters:
element -
Returns:

getGenericElementRule

public static WOMLAbstractNamespace.WOGenericElementRule getGenericElementRule(String elementName)
Returns the generic element rule for the given element name. If the rule for the given element does not exist this will return the default rule.

Parameters:
elementName -
Returns:

getName

public String getName()
Returns the name to which this rule is associated.

Returns:

getGenericElementType

public String getGenericElementType(WOElement element)
Returns either WOGenericElement or WOGenericContainer, depending on the state of the input element. A container is returned if the element has children or if the GenericElementRules require an end tag. The returned type is suitable for finding a type declaration via a WODeclaration.

Parameters:
element -
Returns:

isContainer

public boolean isContainer(String elementName,
                           boolean hasChildren)
Convenience API for getGenericElementType that will return true if the represented elementName and hasChildren should be represented by a container tag (i.e. <div></div> instead of <div/>

Parameters:
element -
Returns:

Last updated June 2008

Copyright © 2000-2008 Apple Inc.