WebObjects 5.4

com.webobjects.appserver.parser.woml.namespaces
Class WOMLGenericElementGenerator

java.lang.Object
  extended by com.webobjects.appserver.parser.woml.namespaces.WOMLGenericElementGenerator
All Implemented Interfaces:
WOMLAbstractNamespace.WOMLElementGenerator
Direct Known Subclasses:
WOMLConditionalElementGenerator, WOMLImageElementGenerator, WOMLRepetitionElementGenerator, WOMLURLElementGenerator

public class WOMLGenericElementGenerator
extends Object
implements WOMLAbstractNamespace.WOMLElementGenerator


Constructor Summary
WOMLGenericElementGenerator()
           
 
Method Summary
 void contributeToDeclaration(WOMLAbstractNamespace namespace, WOMLElement element, com.webobjects.appserver._private.WOMutableDeclaration declaration, NSArray<String> languages, WOAssociationFactory associationFactory)
          Default implementation copies all associations in the given namespace to the declaration.
 WOElement generateElement(WOMLAbstractNamespace namespace, WOMLElement element, WOElement template, com.webobjects.appserver._private.WOMutableDeclaration declaration, NSArray<String> languages, WOAssociationFactory associationFactory)
          Default implementation generates a new dynamic element with the declaration's type and associations.
protected  Map<String,WOAssociation> getElementAssociationsForContribution(WOMLAbstractNamespace namespace, WOMLElement element, WOAssociationFactory associationFactory)
          Returns the map of associations from the element to be used by the default contributeToDeclaration() method.
protected  boolean shouldContributeAssociation(WOMLAbstractNamespace namespace, WOMLElement element, com.webobjects.appserver._private.WOMutableDeclaration declaration, NSArray<String> languages, String name, WOAssociation association)
          Returns true if the given association with the given name should be contributed to the declaration.
protected  boolean shouldKeepExistingAssociation(WOMLAbstractNamespace namespace, WOMLElement element, com.webobjects.appserver._private.WOMutableDeclaration declaration, NSArray<String> languages, String name, WOAssociation association)
          Returns true if the existing association should be kept by the current contributor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOMLGenericElementGenerator

public WOMLGenericElementGenerator()
Method Detail

getElementAssociationsForContribution

protected Map<String,WOAssociation> getElementAssociationsForContribution(WOMLAbstractNamespace namespace,
                                                                          WOMLElement element,
                                                                          WOAssociationFactory associationFactory)
Returns the map of associations from the element to be used by the default contributeToDeclaration() method. The default implementation of this method returns a copy of the elements associations for only the namespace given. This returned map can then be manipulated without altering the associations in the element itself.

Parameters:
namespace -
element -
associationFactory -
Returns:

shouldKeepExistingAssociation

protected boolean shouldKeepExistingAssociation(WOMLAbstractNamespace namespace,
                                                WOMLElement element,
                                                com.webobjects.appserver._private.WOMutableDeclaration declaration,
                                                NSArray<String> languages,
                                                String name,
                                                WOAssociation association)
Returns true if the existing association should be kept by the current contributor. Default implementation return true.

Parameters:
namespace -
element -
declaration -
name -
association -
Returns:

shouldContributeAssociation

protected boolean shouldContributeAssociation(WOMLAbstractNamespace namespace,
                                              WOMLElement element,
                                              com.webobjects.appserver._private.WOMutableDeclaration declaration,
                                              NSArray<String> languages,
                                              String name,
                                              WOAssociation association)
Returns true if the given association with the given name should be contributed to the declaration. The default implementation returns true.

Parameters:
namespace -
element -
declaration -
name -
association -
Returns:

generateElement

public WOElement generateElement(WOMLAbstractNamespace namespace,
                                 WOMLElement element,
                                 WOElement template,
                                 com.webobjects.appserver._private.WOMutableDeclaration declaration,
                                 NSArray<String> languages,
                                 WOAssociationFactory associationFactory)
                          throws WOMLElementGenerationException
Default implementation generates a new dynamic element with the declaration's type and associations.

Specified by:
generateElement in interface WOMLAbstractNamespace.WOMLElementGenerator
Parameters:
namespace -
element -
template -
declaration -
associationFactory -
Returns:
Throws:
WOMLElementGenerationException
See Also:
com.webobjects.appserver.parser.woml.namespaces.WOMLWebObjectsNamespace.WOMLWebObjectsElementGenerator#generateElement(com.webobjects.appserver.parser.woml.WOMLNamespace, com.webobjects.appserver.parser.woml.WOMLElement, com.webobjects.appserver.WOElement, com.webobjects.appserver._private.WOMutableDeclaration, com.webobjects.appserver.WOAssociationFactory)

contributeToDeclaration

public void contributeToDeclaration(WOMLAbstractNamespace namespace,
                                    WOMLElement element,
                                    com.webobjects.appserver._private.WOMutableDeclaration declaration,
                                    NSArray<String> languages,
                                    WOAssociationFactory associationFactory)
                             throws WOMLElementGenerationException
Default implementation copies all associations in the given namespace to the declaration.

Specified by:
contributeToDeclaration in interface WOMLAbstractNamespace.WOMLElementGenerator
Parameters:
namespace -
element -
declaration -
associationFactory -
Throws:
WOMLElementGenerationException
See Also:
com.webobjects.appserver.parser.woml.namespaces.WOMLWebObjectsNamespace.WOMLWebObjectsElementGenerator#contributeToDeclaration(com.webobjects.appserver.parser.woml.WOMLNamespace, com.webobjects.appserver.parser.woml.WOMLElement, com.webobjects.appserver._private.WOMutableDeclaration, com.webobjects.appserver.WOAssociationFactory)

Last updated Tuesday, October 9, 2007 08:58 PDT

Copyright © 2000-2007 Apple Inc.