com.dat.cx
Class CxXmlPort

java.lang.Object
  |
  +--com.dat.cx.CxComponent
        |
        +--com.dat.cx.CxPort
              |
              +--com.dat.cx.CxXmlPort
All Implemented Interfaces:
CxExtendsListener, CxListener, CxPortInterface, CxSource, java.util.EventListener, com.d_a_t.expeval.ExpressionContext
Direct Known Subclasses:
CxDataPort, CxXmlManagerPort

public class CxXmlPort
extends CxPort

CxPort provides semantics for an xml port component. An Xml port may be typed according to the type of xml document it can recieve. If typed, only documents of that type will be processed on recieving a document


Fields inherited from class com.dat.cx.CxComponent
compactDisplay, noHatDisplay, standardDisplay
 
Fields inherited from interface com.dat.cx.CxPortInterface
COMPOSITE, EVENT, INTERFACE, METHOD, PROVIDES, USES
 
Constructor Summary
CxXmlPort()
          Default constructor
CxXmlPort(java.lang.String name, boolean direction, CxComponent type)
          Constructor
 
Method Summary
 XSet export(XSet doc, CxProject project)
          Export the definition of this xml port (only this component)
 CxComponent getDocType()
          Get the document type
 CxProperty getDocTypeProperty()
           
 java.lang.String getPortIcon()
          Get the port icon.
 java.util.Vector importSpec(XSet spec)
          Import specification from an XML element
 void importTemplate(CxComponent from, boolean copy, boolean inherit, boolean inverse)
          Import the definition of an xml port from another xml port.
 boolean isValidEvent(CxXmlEvent xmlEvent)
          Validate that the input event contains a document whose type is compatible with the port
 boolean isXmlPort()
          Determines if the component is an xml port
 void recieve(java.util.EventObject event)
          Recieve an event as required by the CxListener interface.
 void setDocType(CxComponent docType)
          Set the document type
 void setPortIcon(java.lang.String portIcon)
          Set the icon for the port
 
Methods inherited from class com.dat.cx.CxPort
addCxListener, exportInfo, getCxListeners, getDisplay, getEditFrame, getIcon, getPortDirection, hasCxListeners, importInfo, inversePortDirection, isPort, makeInfo, removeCxListener, setPortDirection
 
Methods inherited from class com.dat.cx.CxComponent
activate, addChild, addChildAt, addChildAtNoUndo, addChildNoUndo, addChildNoUndoAssign, addComponentChangeListener, addComponentChildrenListener, addExtendsListener, addSortedChild, canAddComponent, canExtendsAdd, componentAdded, componentLocationChanged, componentNameChanged, componentNodeChanged, componentPropertyChanged, componentRemoved, componentWirePortChanged, constructNode, contains, deactivate, decrUnresolved, exportContent, findPath, findPath, getBaseType, getChild, getChild, getChildren, getClassClause, getConfig, getConfigValue, getConfigValue, getDataPath, getDataPort, getDisplayStyle, getExtendsFrom, getExtendsListeners, getImageIcon, getIndexOfChild, getInfo, getName, getNameInAncestor, getNameInContext, getNextChildTo, getNoChildren, getOwnerProject, getPackage, getPackage, getParent, getPort, getPropertyNames, getPropertyValues, getRoot, getRzChildren, getRzSortedChildren, getSortedChild, getSortedChildren, getSortedIndexOfChild, getViewFrame, getX, getXmlType, getY, handleException, hasChild, hasChild, hasChildren, hasDisplay, hasOverride, hasProperties, importContent, incrUnresolved, init, instantiateChildComponent, instantiateChildComponentAt, isActive, isAttribute, isAttributeInstance, isBaseProperty, isCompositeComponent, isConfiguration, isContentComponent, isDataMgr, isDataPort, isErrorCatchPort, isExtendable, isExtended, isInherited, isInterface, isLibraryComponent, isMiniPort, isName, isNative, isPackage, isPalette, isPin, isPortMgr, isProperty, isRoot, isSubPortOf, isTextInstance, isTypePackage, isVar, isVarInstance, isVarSet, isWire, isXmlPrimative, isXmlString, omitExport, removeChild, removeChild, removeChildNoUndo, removeComponentChangeListener, removeComponentChildrenListener, removeExtendsListener, renameSortedChild, resolveClass, resolveConstructor, resolveField, resolveMethod, setClassClause, setComponentDefinitionServer, setDisplayStyle, setDisplayStyleFromInfo, setExtendsFrom, setInherited, setLocation, setLocationNoUndo, setName, setNameNoTrigger, setNameNoUndo, setNative, setOwnerProject, setParent, setPropertyValues, setX, setY, toString, triggerExtendsNodeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CxXmlPort

public CxXmlPort()
Default constructor

CxXmlPort

public CxXmlPort(java.lang.String name,
                 boolean direction,
                 CxComponent type)
Constructor
Parameters:
name - the name for the port
direction - the direction of the port, true for PROVIDES, false for USES
type - the type of the xml port
Method Detail

isXmlPort

public boolean isXmlPort()
Determines if the component is an xml port
Overrides:
isXmlPort in class CxComponent
Returns:
true if the component is an xml port, otherwise false

importTemplate

public void importTemplate(CxComponent from,
                           boolean copy,
                           boolean inherit,
                           boolean inverse)
Import the definition of an xml port from another xml port.
Overrides:
importTemplate in class CxPort
Parameters:
from - the xml port from which to import a definition
copy - indicate that this is a copy 'vs' extends
inherit - indicate that the definition is inherited as part of an extends
inverse - (not used)

importSpec

public java.util.Vector importSpec(XSet spec)
Import specification from an XML element
Overrides:
importSpec in class CxComponent
Parameters:
spec - the xml element containing the specification

export

public XSet export(XSet doc,
                   CxProject project)
Export the definition of this xml port (only this component)
Overrides:
export in class CxPort
Parameters:
doc - the XSet document being constructed. The definition is added to this document
Returns:
the XSet document relative to the new definition

recieve

public void recieve(java.util.EventObject event)
Recieve an event as required by the CxListener interface. If docType has been set, then only process and send the event if the recieved document is of the specified document type.
Overrides:
recieve in class CxPort
Parameters:
event - the recieved event

isValidEvent

public boolean isValidEvent(CxXmlEvent xmlEvent)
Validate that the input event contains a document whose type is compatible with the port
Parameters:
xmlEvent - the input event containing the document
Returns:
true if the input event contains a document whose type is compatible with the port, otherwise false.

getDocType

public CxComponent getDocType()
Get the document type
Returns:
the document type

getDocTypeProperty

public CxProperty getDocTypeProperty()

setDocType

public void setDocType(CxComponent docType)
Set the document type
Parameters:
docType - the new document type

getPortIcon

public java.lang.String getPortIcon()
Get the port icon. Returns null if an icon has not been specified
Returns:
the port Icon

setPortIcon

public void setPortIcon(java.lang.String portIcon)
Set the icon for the port
Parameters:
portIcon - the port icon