org.netbeans.modules.xml.wsdl.model.impl
Class WSDLModelImpl

java.lang.Object
  extended by org.netbeans.modules.xml.xam.AbstractModel<T>
      extended by org.netbeans.modules.xml.xam.dom.AbstractDocumentModel<WSDLComponent>
          extended by org.netbeans.modules.xml.wsdl.model.WSDLModel
              extended by org.netbeans.modules.xml.wsdl.model.impl.WSDLModelImpl
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.UndoableEditListener, DocumentModel<WSDLComponent>, Model<WSDLComponent>, Referenceable

public class WSDLModelImpl
extends WSDLModel

Author:
rico, Nam Nguyen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.netbeans.modules.xml.xam.AbstractModel
AbstractModel.ModelUndoableEdit, AbstractModel.ModelUndoableEditSupport
 
Nested classes/interfaces inherited from interface org.netbeans.modules.xml.xam.Model
Model.State
 
Field Summary
 
Fields inherited from class org.netbeans.modules.xml.xam.dom.AbstractDocumentModel
access
 
Fields inherited from class org.netbeans.modules.xml.xam.AbstractModel
ues
 
Fields inherited from interface org.netbeans.modules.xml.xam.Model
STATE_PROPERTY
 
Constructor Summary
WSDLModelImpl(ModelSource source)
           
 
Method Summary
 WSDLComponent createComponent(WSDLComponent parent, org.w3c.dom.Element element)
          Create component to be added as child of given component.
 WSDLComponent createRootComponent(org.w3c.dom.Element root)
           
 AbstractDocumentComponent findComponent(AbstractDocumentComponent current, java.util.List<org.w3c.dom.Element> pathFromRoot, int iCurrent)
           
<T extends ReferenceableWSDLComponent>
T
findComponentByName(javax.xml.namespace.QName name, java.lang.Class<T> type)
          Find named WSDL component by QName and type.
<T extends ReferenceableWSDLComponent>
T
findComponentByName(java.lang.String name, java.lang.Class<T> type)
          Find named WSDL component by name and type within current model.
 java.util.List<org.netbeans.modules.xml.schema.model.Schema> findSchemas(java.lang.String namespace)
          Search for all schemas visible from imported/included/redefined in the schema extensibility elements.
 java.util.List<WSDLModel> findWSDLModel(java.lang.String namespace)
          Search from all imported WSDL models those with specified target namespace.
protected  ComponentUpdater<WSDLComponent> getComponentUpdater()
           
 Definitions getDefinitions()
           
 java.util.Set<java.lang.String> getElementNames()
           
(package private)  ElementFactoryRegistry getElementRegistry()
           
 java.util.List<org.netbeans.modules.xml.schema.model.SchemaModel> getEmbeddedSchemaModels()
           
 WSDLComponentFactory getFactory()
           
 java.util.List<org.netbeans.modules.xml.schema.model.SchemaModel> getImportedSchemaModels()
           
 java.util.List<WSDLModel> getImportedWSDLModels()
           
 java.util.Set<javax.xml.namespace.QName> getQNames()
          Returns QName of elements used in model.
 java.util.Map<javax.xml.namespace.QName,java.util.List<javax.xml.namespace.QName>> getQNameValuedAttributes()
          Returns QName of all attributes with QName value, sorted by containing element QName.
 WSDLComponent getRootComponent()
          Returns model root component.
 ChangeInfo prepareChangeInfo(java.util.List<org.w3c.dom.Node> pathToRoot)
           
 SyncUnit prepareSyncUnit(ChangeInfo changes, SyncUnit unit)
           
 void setDefinitions(Definitions def)
           
 
Methods inherited from class org.netbeans.modules.xml.xam.dom.AbstractDocumentModel
addChildComponent, areSameNodes, findComponent, findComponent, findComponent, firePropertyChangedEvents, firePropertyChangedEvents, getAccess, getAccessProvider, getBaseDocument, getDocument, getXPathExpression, isDomainElement, needsSync, processSyncUnit, refresh, removeChildComponent, setIdentifyingAttributes, syncCompleted, syncStarted, toLocalName
 
Methods inherited from class org.netbeans.modules.xml.xam.AbstractModel
addComponentListener, addPropertyChangeListener, addUndoableEditListener, addUndoableRefactorListener, createModelUndoableEdit, endTransaction, endTransaction, finishTransaction, fireComponentChangedEvent, firePropertyChangeEvent, getModelSource, getState, inSync, inUndoRedo, isAutoSyncActive, isIntransaction, removeComponentListener, removePropertyChangeListener, removeUndoableEditListener, removeUndoableRefactorListener, rollbackTransaction, setAutoSyncActive, setInSync, setInUndoRedo, setState, startedFiringEvents, startTransaction, sync, transactionCompleted, transactionStarted, undoableEditHappened, validateWrite
 
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.xml.xam.Model
addComponentListener, addPropertyChangeListener, addUndoableEditListener, addUndoableRefactorListener, endTransaction, getModelSource, getState, inSync, isIntransaction, removeComponentListener, removePropertyChangeListener, removeUndoableEditListener, removeUndoableRefactorListener, startTransaction, sync
 

Constructor Detail

WSDLModelImpl

public WSDLModelImpl(ModelSource source)
Method Detail

createRootComponent

public WSDLComponent createRootComponent(org.w3c.dom.Element root)
Specified by:
createRootComponent in class AbstractDocumentModel<WSDLComponent>

getRootComponent

public WSDLComponent getRootComponent()
Description copied from interface: DocumentModel
Returns model root component.


createComponent

public WSDLComponent createComponent(WSDLComponent parent,
                                     org.w3c.dom.Element element)
Description copied from interface: DocumentModel
Create component to be added as child of given component.


getComponentUpdater

protected ComponentUpdater<WSDLComponent> getComponentUpdater()
Specified by:
getComponentUpdater in class AbstractDocumentModel<WSDLComponent>

getFactory

public WSDLComponentFactory getFactory()
Specified by:
getFactory in class WSDLModel
Returns:
WSDL component factory.

setDefinitions

public void setDefinitions(Definitions def)

getDefinitions

public Definitions getDefinitions()
Specified by:
getDefinitions in class WSDLModel
Returns:
WSDL model root component 'definitions'

getElementRegistry

ElementFactoryRegistry getElementRegistry()

getImportedWSDLModels

public java.util.List<WSDLModel> getImportedWSDLModels()

getImportedSchemaModels

public java.util.List<org.netbeans.modules.xml.schema.model.SchemaModel> getImportedSchemaModels()

getEmbeddedSchemaModels

public java.util.List<org.netbeans.modules.xml.schema.model.SchemaModel> getEmbeddedSchemaModels()

findWSDLModel

public java.util.List<WSDLModel> findWSDLModel(java.lang.String namespace)
Description copied from class: WSDLModel
Search from all imported WSDL models those with specified target namespace.

Specified by:
findWSDLModel in class WSDLModel
Parameters:
namespace - the target namespace to search for model
Returns:
list WSDL models or empty list if none found.

findSchemas

public java.util.List<org.netbeans.modules.xml.schema.model.Schema> findSchemas(java.lang.String namespace)
Description copied from class: WSDLModel
Search for all schemas visible from imported/included/redefined in the schema extensibility elements. Schema model imported through wsdl:import are also in the search.

Specified by:
findSchemas in class WSDLModel
Parameters:
namespace - the target namespace to search for model
Returns:
list of schema match the give namespace.

findComponentByName

public <T extends ReferenceableWSDLComponent> T findComponentByName(java.lang.String name,
                                                                    java.lang.Class<T> type)
Description copied from class: WSDLModel
Find named WSDL component by name and type within current model.

Specified by:
findComponentByName in class WSDLModel
Parameters:
name - local name of target component
type - type of target component
Returns:
WSDL component of specified type and name; null if not found.

findComponentByName

public <T extends ReferenceableWSDLComponent> T findComponentByName(javax.xml.namespace.QName name,
                                                                    java.lang.Class<T> type)
Description copied from class: WSDLModel
Find named WSDL component by QName and type.

Specified by:
findComponentByName in class WSDLModel
Parameters:
name - QName of the target component.
type - type of target component
Returns:
WSDL component of specified type and name; null if not found.

getQNames

public java.util.Set<javax.xml.namespace.QName> getQNames()
Description copied from class: AbstractDocumentModel
Returns QName of elements used in model. Domain model implementation needs to override this to be able to embed elements outside of the domain such as child elements of documentation in schema model.

Overrides:
getQNames in class AbstractDocumentModel<WSDLComponent>
Returns:
full set of element QName's or null if there is no needs for distinction between domain and non-domain elements.

getElementNames

public java.util.Set<java.lang.String> getElementNames()
Overrides:
getElementNames in class AbstractDocumentModel<WSDLComponent>

prepareChangeInfo

public ChangeInfo prepareChangeInfo(java.util.List<org.w3c.dom.Node> pathToRoot)
Overrides:
prepareChangeInfo in class AbstractDocumentModel<WSDLComponent>

prepareSyncUnit

public SyncUnit prepareSyncUnit(ChangeInfo changes,
                                SyncUnit unit)
Overrides:
prepareSyncUnit in class AbstractDocumentModel<WSDLComponent>

findComponent

public AbstractDocumentComponent findComponent(AbstractDocumentComponent current,
                                               java.util.List<org.w3c.dom.Element> pathFromRoot,
                                               int iCurrent)
Overrides:
findComponent in class AbstractDocumentModel<WSDLComponent>

getQNameValuedAttributes

public java.util.Map<javax.xml.namespace.QName,java.util.List<javax.xml.namespace.QName>> getQNameValuedAttributes()
Description copied from class: AbstractDocumentModel
Returns QName of all attributes with QName value, sorted by containing element QName. Note: if domain model implementation return null, namespace consolidation will not attempt namespace prefix refactoring on each mutation of the underlying XDM DOM tree.

Overrides:
getQNameValuedAttributes in class AbstractDocumentModel<WSDLComponent>