org.netbeans.modules.bpel.model.impl
Class BpelEntityImpl

java.lang.Object
  extended by org.netbeans.modules.xml.xam.AbstractComponent<C>
      extended by org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent<BpelEntity>
          extended by org.netbeans.modules.bpel.model.impl.BpelEntityImpl
All Implemented Interfaces:
BpelEntity, Component<BpelEntity>, DocumentComponent<BpelEntity>, DocumentModelAccess.NodeUpdater
Direct Known Subclasses:
BpelContainerImpl, ExpressionImpl, FromPartImpl, ToPartImpl

public abstract class BpelEntityImpl
extends AbstractDocumentComponent<BpelEntity>
implements BpelEntity

Author:
ads

Nested Class Summary
(package private)  class BpelEntityImpl.IdMapKey
           
 
Nested classes/interfaces inherited from class org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent
AbstractDocumentComponent.PrefixAttribute
 
Field Summary
 
Fields inherited from interface org.netbeans.modules.bpel.model.api.BpelEntity
BUSINESS_PROCESS_1_1_NS_URI, BUSINESS_PROCESS_DRAFT_NS_URI, BUSINESS_PROCESS_NS_URI
 
Fields inherited from interface org.netbeans.modules.xml.xam.dom.DocumentComponent
TEXT_CONTENT_PROPERTY
 
Constructor Summary
BpelEntityImpl(BpelBuilderImpl builder, BpelElements elem)
           
BpelEntityImpl(BpelBuilderImpl builder, java.lang.String tagName)
          This constructor is designed only for using in builder.
BpelEntityImpl(BpelModelImpl model, org.w3c.dom.Element e)
           
 
Method Summary
 void accept(SimpleBpelModelVisitor visitor)
          This method will apply visitor to each element in model starting from this.
protected  void acceptChildren(SimpleBpelModelVisitor visitor)
           
 boolean canPaste(Component child)
          Default implementation, subclass need to override if needed.
protected  void checkDeleted()
           
protected  void checkInTree()
           
 BpelEntity copy(BpelEntity parent)
          Returns a copy of this component for adding into the given parent component.
 BpelEntity copy(java.util.HashMap<UniqueId,UniqueId> uniqueMap)
          Creates deep copy of OM element.
<T extends BpelReferenceable>
BpelReference<T>
createReference(T target, java.lang.Class<T> type)
           
<T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent>
SchemaReference<T>
createSchemaReference(T target, java.lang.Class<T> type)
           
<T extends ReferenceableWSDLComponent>
WSDLReference<T>
createWSDLReference(T target, java.lang.Class<T> type)
           
 BpelEntity cut()
          Returns element that is copy of this element.
 java.lang.String getAttribute(Attribute attr)
           
(package private)  AttributeAccess getAttributeAccess()
           
protected  java.lang.Object getAttributeValueOf(Attribute attr, java.lang.String stringValue)
           
protected  TBoolean getBooleanAttribute(Attribute attr)
           
 BpelModelImpl getBpelModel()
          Accessor to model.
protected
<T extends BpelReferenceable>
BpelReference<T>
getBpelReference(Attribute attr, java.lang.Class<T> clazz)
           
protected
<T extends BpelReferenceable>
java.util.List<BpelReference<T>>
getBpelReferenceList(Attribute attr, java.lang.Class<T> type)
           
 java.lang.Object getCookie(java.lang.Object key)
          Returns stored object with given key that was previusly put into this entity via setCookie.
(package private)  java.util.Map<java.lang.Object,java.lang.Object> getCookies()
           
protected  java.lang.String getCorrectedText()
          This method is return corrected Text content without XML comments.
protected abstract  Attribute[] getDomainAttributes()
          This method should be implemented by any real class.
protected  java.lang.String getEntityName()
           
 BpelModelImpl getModel()
           
 org.netbeans.modules.xml.xpath.ext.schema.ExNamespaceContext getNamespaceContext()
          Returns ExNamespaceContext context for this element.
 BpelContainerImpl getParent()
          
protected  javax.xml.namespace.QName getQNameAttribute(Attribute attr)
           
protected
<T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent>
SchemaReference<T>
getSchemaReference(Attribute attr, java.lang.Class<T> clazz)
           
protected
<T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent>
java.util.List<SchemaReference<T>>
getSchemaReferenceList(Attribute attr, java.lang.Class<T> type)
           
protected  java.lang.String getText()
          Return text value of this component.
 UniqueId getUID()
          Returns unique id of element in OM.
protected
<T extends ReferenceableWSDLComponent>
WSDLReference<T>
getWSDLReference(Attribute attr, java.lang.Class<T> clazz)
           
protected
<T extends ReferenceableWSDLComponent>
java.util.List<WSDLReference<T>>
getWSDLReferenceList(Attribute attr, java.lang.Class<T> type)
           
(package private)  void handleAttributeChange(org.w3c.dom.Node oldAttr, org.w3c.dom.Node newAttr)
           
(package private)  boolean isDeleted()
           
(package private)  boolean isInTree()
           
protected  void populateChildren(java.util.List<BpelEntity> children)
           
protected  void postGlobalEvent(ChangeEvent event)
           
protected  void postGlobalEvent(ChangeEvent event, boolean propogateToModel)
           
protected  void readLock()
           
protected  void readUnlock()
           
protected  void removeAttribute(Attribute attr)
           
 void removeCookie(java.lang.Object obj)
          Removes object with given key from cookies.
protected  void removeReference(BpelAttributes attr)
           
 void setAttribute(java.lang.String propName, Attribute attr, java.lang.Object value)
          Sets the component attribute String value and fire property change event with the given property name.
protected  void setBpelAttribute(Attribute attr, java.lang.Enum value)
           
protected  void setBpelAttribute(Attribute attr, javax.xml.namespace.QName qName)
           
protected  void setBpelAttribute(Attribute attr, java.lang.String value)
           
protected
<T extends BpelReferenceable>
void
setBpelReference(Attribute attr, BpelReference<T> ref)
           
protected
<T extends BpelReferenceable>
void
setBpelReferenceList(Attribute attr, java.lang.Class<T> type, java.util.List<BpelReference<T>> list)
           
 void setCookie(java.lang.Object key, java.lang.Object obj)
          Set cookie for this entity.
(package private)  void setCookies(java.util.Map<java.lang.Object,java.lang.Object> cookieSet)
           
(package private)  void setDeleted()
           
protected  void setInTree()
           
protected  void setInTreeRecursively()
           
protected
<T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent>
void
setSchemaReference(Attribute attr, SchemaReference<T> ref)
           
protected  void setText(java.lang.String text)
           
protected  void setText(java.lang.String propName, java.lang.String text)
          Set text value of the component.
(package private)  void setUID(UniqueId id)
           
protected
<T extends ReferenceableWSDLComponent>
void
setWSDLReference(Attribute attr, WSDLReference<T> ref)
           
protected
<T extends ReferenceableWSDLComponent>
void
setWSDLReferenceList(Attribute attr, java.lang.Class<T> type, java.util.List<WSDLReference<T>> list)
           
(package private)  void updateReference(Reference reference, BpelReferenceable subject)
          This method changes old reference reference to new reference with referenceable object subject
protected  void writeLock()
           
protected  void writeUnlock()
           
 
Methods inherited from class org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent
addPrefix, appendChildQuietly, createPrefixAttribute, ensureUnique, ensureValueNamespaceDeclared, findAttributePosition, findChildComponent, findChildComponentByIdentity, findDomainIndex, findPosition, fireChildAdded, fireChildRemoved, firePropertyChange, fireValueChanged, getAccess, getAnyAttribute, getAttributeMap, getChildElement, getChildElementText, getEffectiveParent, getLeadingText, getNamespaceURI, getNodeIndexOf, getPeer, getPrefixedName, getPrefixedName, getPrefixedName, getPrefixes, getQName, getQName, getText, getText, getTrailingText, getXmlFragment, getXmlFragmentInclusive, insertAtIndexQuietly, isInDocumentModel, lookupNamespaceURI, lookupNamespaceURI, lookupPrefix, referencesSameNode, removeAttributeQuietly, removeChildQuietly, removePrefix, resolveModel, setAnyAttribute, setAttributeQuietly, setChildElementText, setLeadingText, setQNameAttribute, setText, setTrailingText, setXmlFragment, updatePeer, updateReference, updateReference, updateReference, verifyWrite
 
Methods inherited from class org.netbeans.modules.xml.xam.AbstractComponent
addAfter, addBefore, addPropertyChangeListener, appendChild, checkNullOrDuplicateChild, getChild, getChildren, getChildren, getChildren, insertAtIndex, insertAtIndex, isChildrenInitialized, removeChild, removeComponentListener, removePropertyChangeListener, setChild, setChild, setChildAfter, setChildBefore, setModel, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.netbeans.modules.bpel.model.api.BpelEntity
accept, getElementType
 
Methods inherited from interface org.netbeans.modules.xml.xam.dom.DocumentComponent
findAttributePosition, findChildComponent, findPosition, getPeer, isInDocumentModel, referencesSameNode
 
Methods inherited from interface org.netbeans.modules.xml.xam.Component
getChildren, getChildren, getChildren
 

Constructor Detail

BpelEntityImpl

BpelEntityImpl(BpelModelImpl model,
               org.w3c.dom.Element e)

BpelEntityImpl

BpelEntityImpl(BpelBuilderImpl builder,
               java.lang.String tagName)
This constructor is designed only for using in builder. Here some inner events will be generated when new element is created via builder.


BpelEntityImpl

public BpelEntityImpl(BpelBuilderImpl builder,
                      BpelElements elem)
Method Detail

getDomainAttributes

protected abstract Attribute[] getDomainAttributes()
This method should be implemented by any real class. It returns list of possible attributes for entity. It used in firing event about attribute change while synchronizing with source.


getBpelModel

public BpelModelImpl getBpelModel()
Description copied from interface: BpelEntity
Accessor to model. It should be used for getting reference to model instead of acccessing to root process ( process could be got from Model ). Note that this method returns always not null reference to model, even if component is deleted. It differs from getModel() method which return null in this case.

Specified by:
getBpelModel in interface BpelEntity
Returns:
bpel OM model.

getModel

public BpelModelImpl getModel()
Specified by:
getModel in interface Component<BpelEntity>
Overrides:
getModel in class AbstractDocumentComponent<BpelEntity>
Returns:
the model where this element is being used or null if not currently part of a model.

canPaste

public boolean canPaste(Component child)
Description copied from class: AbstractComponent
Default implementation, subclass need to override if needed.

Specified by:
canPaste in interface Component<BpelEntity>
Overrides:
canPaste in class AbstractComponent<BpelEntity>

copy

public BpelEntity copy(java.util.HashMap<UniqueId,UniqueId> uniqueMap)
Description copied from interface: BpelEntity
Creates deep copy of OM element. uniqueMap is used for storing correspondance between this element and return element. Uid of this copied element ( end each deep child ) will be null. After attaching element to OM it will have different uid . Cookies are not copied for copy element ( and any child ).

Specified by:
copy in interface BpelEntity
Parameters:
uniqueMap - map that will be used for filling unique ids.
Returns:
copy of this entity.

getParent

public final BpelContainerImpl getParent()
Description copied from interface: BpelEntity

Specified by:
getParent in interface BpelEntity
Specified by:
getParent in interface Component<BpelEntity>
Overrides:
getParent in class AbstractComponent<BpelEntity>
Returns:
parent component.

cut

public BpelEntity cut()
Description copied from interface: BpelEntity
Returns element that is copy of this element. This element and all its children will have the same unique ids. Original element ( this ) is removed from tree. Uid of this element ( and each child ) will be null. After pasting element into OM pasted element ( and its children respectively ) will have the same uid as original. After pasting element will be invalid and if you will use it for new pasting then it will be the same as pasting of copy ( see copy method ). All cookies from original element will be saved for cut element ( and any child ).

Specified by:
cut in interface BpelEntity
Returns:
copy of this entity that could be used for inserting in OM.

copy

public BpelEntity copy(BpelEntity parent)
Description copied from interface: Component
Returns a copy of this component for adding into the given parent component.

Specified by:
copy in interface Component<BpelEntity>
Overrides:
copy in class AbstractDocumentComponent<BpelEntity>

getUID

public UniqueId getUID()
Description copied from interface: BpelEntity
Returns unique id of element in OM. This uid will be null if element was created via factory ( BpelElementBuilder class ). Element could have not null uid even if it not in OM. This will be in case when it was copied or cut.

Specified by:
getUID in interface BpelEntity
Returns:
unique id of this entity.

getNamespaceContext

public org.netbeans.modules.xml.xpath.ext.schema.ExNamespaceContext getNamespaceContext()
Description copied from interface: BpelEntity
Returns ExNamespaceContext context for this element. This context can be used for retrieving prefixes by uri, uri by prefixes.

Specified by:
getNamespaceContext in interface BpelEntity
Returns:
namespace context object.

accept

public final void accept(SimpleBpelModelVisitor visitor)
Description copied from interface: BpelEntity
This method will apply visitor to each element in model starting from this. visitor should not know nothing about OM tree structure. It means it should not perfrom navigation through children in "visit" method. Om element "accept" method will apply visitor to any child itself.

Specified by:
accept in interface BpelEntity
Parameters:
visitor - visitor for OM.

getCookie

public java.lang.Object getCookie(java.lang.Object key)
Description copied from interface: BpelEntity
Returns stored object with given key that was previusly put into this entity via setCookie.

Specified by:
getCookie in interface BpelEntity
Parameters:
key - key for cookie retrieveing
Returns:
object that stored as cookie identified by key.

setCookie

public void setCookie(java.lang.Object key,
                      java.lang.Object obj)
Description copied from interface: BpelEntity
Set cookie for this entity.

Specified by:
setCookie in interface BpelEntity
Parameters:
key - key for cookie.
obj - any object that we want to store here.

removeCookie

public void removeCookie(java.lang.Object obj)
Description copied from interface: BpelEntity
Removes object with given key from cookies.

Specified by:
removeCookie in interface BpelEntity
Parameters:
obj - key of object that we want to remove from cookies.

createSchemaReference

public <T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent> SchemaReference<T> createSchemaReference(T target,
                                                                                                                               java.lang.Class<T> type)

createReference

public <T extends BpelReferenceable> BpelReference<T> createReference(T target,
                                                                      java.lang.Class<T> type)

createWSDLReference

public <T extends ReferenceableWSDLComponent> WSDLReference<T> createWSDLReference(T target,
                                                                                   java.lang.Class<T> type)

getAttribute

public java.lang.String getAttribute(Attribute attr)
Specified by:
getAttribute in interface DocumentComponent<BpelEntity>
Overrides:
getAttribute in class AbstractDocumentComponent<BpelEntity>
Returns:
attribute value or null if the attribute is currently undefined

setAttribute

public void setAttribute(java.lang.String propName,
                         Attribute attr,
                         java.lang.Object value)
Description copied from class: AbstractDocumentComponent
Sets the component attribute String value and fire property change event with the given property name.

Specified by:
setAttribute in interface DocumentComponent<BpelEntity>
Overrides:
setAttribute in class AbstractDocumentComponent<BpelEntity>
Parameters:
propName - property name to be used in firing property change event.
attr - attribute name
value - for the attribute.

acceptChildren

protected void acceptChildren(SimpleBpelModelVisitor visitor)
Parameters:
visitor -

getBooleanAttribute

protected TBoolean getBooleanAttribute(Attribute attr)

getBpelReferenceList

protected <T extends BpelReferenceable> java.util.List<BpelReference<T>> getBpelReferenceList(Attribute attr,
                                                                                              java.lang.Class<T> type)

getWSDLReferenceList

protected <T extends ReferenceableWSDLComponent> java.util.List<WSDLReference<T>> getWSDLReferenceList(Attribute attr,
                                                                                                       java.lang.Class<T> type)

getSchemaReferenceList

protected <T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent> java.util.List<SchemaReference<T>> getSchemaReferenceList(Attribute attr,
                                                                                                                                                   java.lang.Class<T> type)

setBpelReferenceList

protected <T extends BpelReferenceable> void setBpelReferenceList(Attribute attr,
                                                                  java.lang.Class<T> type,
                                                                  java.util.List<BpelReference<T>> list)

setWSDLReferenceList

protected <T extends ReferenceableWSDLComponent> void setWSDLReferenceList(Attribute attr,
                                                                           java.lang.Class<T> type,
                                                                           java.util.List<WSDLReference<T>> list)

setBpelAttribute

protected void setBpelAttribute(Attribute attr,
                                java.lang.String value)
                         throws VetoException
Throws:
VetoException

setBpelAttribute

protected void setBpelAttribute(Attribute attr,
                                java.lang.Enum value)

setBpelAttribute

protected void setBpelAttribute(Attribute attr,
                                javax.xml.namespace.QName qName)
                         throws VetoException
Throws:
VetoException

getQNameAttribute

protected javax.xml.namespace.QName getQNameAttribute(Attribute attr)

setText

protected void setText(java.lang.String propName,
                       java.lang.String text)
Description copied from class: AbstractDocumentComponent
Set text value of the component. This is for pure text-usage by documentation components. The children of peer node will be replaced with single text node having given text.

Overrides:
setText in class AbstractDocumentComponent<BpelEntity>
Parameters:
propName - name of property event to fire
text - text value to set to.

setText

protected void setText(java.lang.String text)
                throws VetoException
Throws:
VetoException

removeAttribute

protected void removeAttribute(Attribute attr)

getBpelReference

protected <T extends BpelReferenceable> BpelReference<T> getBpelReference(Attribute attr,
                                                                          java.lang.Class<T> clazz)

getWSDLReference

protected <T extends ReferenceableWSDLComponent> WSDLReference<T> getWSDLReference(Attribute attr,
                                                                                   java.lang.Class<T> clazz)

getSchemaReference

protected <T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent> SchemaReference<T> getSchemaReference(Attribute attr,
                                                                                                                               java.lang.Class<T> clazz)

setBpelReference

protected <T extends BpelReferenceable> void setBpelReference(Attribute attr,
                                                              BpelReference<T> ref)

setWSDLReference

protected <T extends ReferenceableWSDLComponent> void setWSDLReference(Attribute attr,
                                                                       WSDLReference<T> ref)

setSchemaReference

protected <T extends org.netbeans.modules.xml.schema.model.ReferenceableSchemaComponent> void setSchemaReference(Attribute attr,
                                                                                                                 SchemaReference<T> ref)

removeReference

protected void removeReference(BpelAttributes attr)

getCorrectedText

protected java.lang.String getCorrectedText()
This method is return corrected Text content without XML comments. See the problem appeared in getText() method.


getText

protected java.lang.String getText()
Description copied from class: AbstractDocumentComponent
Return text value of this component. This is for text-usage by doucmentation components. Non-text children node are ignored.

Overrides:
getText in class AbstractDocumentComponent<BpelEntity>
Returns:
aggregated text string of all child text nodes.

populateChildren

protected void populateChildren(java.util.List<BpelEntity> children)
Specified by:
populateChildren in class AbstractDocumentComponent<BpelEntity>

getAttributeValueOf

protected java.lang.Object getAttributeValueOf(Attribute attr,
                                               java.lang.String stringValue)
Specified by:
getAttributeValueOf in class AbstractDocumentComponent<BpelEntity>

readLock

protected final void readLock()

readUnlock

protected final void readUnlock()

writeLock

protected final void writeLock()

writeUnlock

protected final void writeUnlock()

checkInTree

protected final void checkInTree()

checkDeleted

protected final void checkDeleted()

getEntityName

protected final java.lang.String getEntityName()

setInTree

protected final void setInTree()

setInTreeRecursively

protected final void setInTreeRecursively()

updateReference

void updateReference(Reference reference,
                     BpelReferenceable subject)
This method changes old reference reference to new reference with referenceable object subject


handleAttributeChange

void handleAttributeChange(org.w3c.dom.Node oldAttr,
                           org.w3c.dom.Node newAttr)

setUID

void setUID(UniqueId id)

getCookies

java.util.Map<java.lang.Object,java.lang.Object> getCookies()

setCookies

void setCookies(java.util.Map<java.lang.Object,java.lang.Object> cookieSet)

isInTree

final boolean isInTree()

isDeleted

final boolean isDeleted()

setDeleted

final void setDeleted()

postGlobalEvent

protected void postGlobalEvent(ChangeEvent event,
                               boolean propogateToModel)

postGlobalEvent

protected void postGlobalEvent(ChangeEvent event)

getAttributeAccess

final AttributeAccess getAttributeAccess()