Package mgui.interfaces.xml
Interface XMLObject
- All Known Subinterfaces:
DataSourceItem,MguiNumber,Shape
- All Known Implementing Classes:
AbstractGraphEdge,AbstractGraphNode,AbstractNetworkGraph,AbstractNetworkGraphConnection,AbstractNetworkGraphNode,Attribute,AttributeList,AttributeObjectVideoTask,AttributeSelection,AttributeSelectionMap,BoolPolygon2DInt,Box3D,Box3DInt,Camera3D,CaminoProcess,CaminoProject,CaretAreaColourInOptions,CaretAreaColourOutputOptions,CaretMetricInOptions,CaretMetricOptions,CaretPaintInOptions,CaretPaintOutOptions,CaretSurfaceInOptions,CaretSurfaceOutOptions,ChangeSectionVideoTask,Circle2D,Circle2DInt,Colour,Colour1f,Colour2f,Colour3f,Colour4f,ColourMap,ContinuousColourMap,CorticalHemisphereSet3DInt,CorticalNetworkGraph,CorticalNetworkGraphConnection,CorticalNetworkGraphNode,CorticalNetworkMatrixInOptions,CorticalSurfaceSet3DInt,Cube3D,DataConnection,DataField,DataQuery,DataSource,DataSourceOutOptions,DataTable,DataTableSet,DefaultGraph,DefaultGraphEdge,DefaultGraphNode,DefaultIOOptions,DiscreteColourMap,DiscreteColourMapInOptions,DiscreteColourMapOutOptions,Ellipse2D,Ellipse2DInt,ExportDataTableExcelOptions,ExportDataTableOptions,ExportDataTableTextOptions,FreesurferSurfaceOutputOptions,FreesurferVertexDataInOptions,GiftiInputOptions,GiftiOutputOptions,Graph2D,Graph2DInt,Graph3D,Graph3DInt,Graph3DOutputOptions,GraphInputOptions,GraphOutputOptions,Grid3D,GridVertexDataColumn,Image2DInt,Image3DInt,ImageStackVideoOptions,ImportDataTableOptions,ImportDataTableTextOptions,InterfaceAbstractGraph,InterfaceConsoleDisplay,InterfaceDataTable,InterfaceDataTableTitle,InterfaceDisplayPanel,InterfaceGraphDisplay,InterfaceGraphDisplayTitle,InterfaceGraphic,InterfaceGraphic2D,InterfaceGraphic3D,InterfaceGraphicWindow,InterfaceIOOptions,InterfaceLayoutWindow,InterfacePipeline,InterfacePlotDisplay,InterfaceProject,InterfaceShape,InterfaceSplitPanel,InterfaceTabbedDisplayPanel,InterfaceWorkspace,IntPolygon2DInt,JavaProcess,LayoutItem,Line2DInt,LineSegment2D,LineSegment3D,LPolygon2DInt,LPolygon3DInt,Map,Map2D,Map3D,MatrixInOptions,MatrixInt,MatrixOutOptions,Mesh2DInt,Mesh3D,Mesh3DInt,MguiBoolean,MguiDouble,MguiFloat,MguiInteger,MguiLong,MguiShort,MincSurfaceDataInOptions,MincSurfaceDataOutOptions,MorphSections3DInt,NameMap,NameMapInOptions,NameMapOutOptions,NativeProcess,NeuralNetConnection,NeuralNetGraph,NeuralNetNode,PajekGraphInputOptions,PipelineFork,PipelineInputOptions,PipelineOutputOptions,PipelineProcess,PipelineProcessInstance,PipelineProcessLibrary,PipelineTask,Plane3D,Plane3DInt,Point2D,Point2DInt,PointSet2D,PointSet2DInputOptions,PointSet2DInt,PointSet3D,PointSet3DDataInputOptions,PointSet3DInputOptions,PointSet3DInt,Polygon2D,Polygon2DInt,Polygon3D,Polygon3DInt,PolygonSet3DInputOptions,PolygonSet3DInt,ProjectDirectory,ProjectInstance,RadialRep2D,RadialRep2DInt,Radius2D,Rect2D,Rect2DInt,Rect3D,Rect3DInt,RotateView3DTask,SectionSet2DInt,SectionSet3DInt,SetView3DTask,Shape2D,Shape2DInt,Shape2DSelectionSet,Shape3D,Shape3DInt,ShapeAttribute,ShapeDataInputOptions,ShapeInputOptions,ShapeModel3D,ShapeModel3DInputOptions,ShapeModel3DOutputOptions,ShapeOutputOptions,ShapeSelectionSet,ShapeSet2DInt,ShapeSet3DInt,Sphere3D,StlOutputOptions,StringVectorInOptions,StringVectorInt,SurfaceDataInputOptions,SurfaceDataOutputOptions,SurfaceInputOptions,SurfaceOutputOptions,TensorVolume3DInt,TestTextureInt,Text2D,Text2DInt,Text2DIntMouseCoords,Triangle2D,Triangle3D,VariableInt,Vector2D,Vector2DInt,Vector3ColourMap,Vector3D,Vector3DInputOptions,Vector3DInt,VectorInt,VectorSet3DInputOptions,VectorSet3DInt,VertexDataColumn,Video,Video3D,VideoInputOptions,VideoOutputOptions,VideoTask,VideoTask3D,View3D,View3DInputOptions,View3DOutputOptions,Volume2DInt,Volume3DInt,Volume4DInputOptions,Volume4DInt,VolumeInputOptions,VolumeInputOptions,VolumeOutputOptions,VolumeSet3DInt,WindowedColourModel,WorkspaceOutputOptions,X3DScene3DInt,XMLOutputOptions
public interface XMLObject
Interface specifies methods for obtaining or writing the data contained in an implementing class in XML
format.
See http://www.saxproject.org for further information.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classXMLObject.XMLEncodingDefines the data I/O encoding, for internal XML representations.static classXMLObject.XMLTypeDefines the type of XML write to perform: Normal: Objects are written by reference if possible, fully otherwise Full: Objects are fully written Reference: Objects are written by reference if possible, short otherwise Short: Objects are written in short form -
Method Summary
Modifier and Type Method Description java.lang.StringgetDTD()Returns the Data Type Declaration (DTD) for this object's XML representationjava.lang.StringgetLocalName()Returns the local name associated with this XML object.java.lang.StringgetShortXML(int tab)Returns a short XML representation of this object.java.lang.StringgetXML()Returns this object's XML representation as a single string.java.lang.StringgetXML(int tab)Returns this object's XML representation as a single string.java.lang.StringgetXMLSchema()Returns the XML schema for this object's XML representationvoidhandleXMLElementEnd(java.lang.String localName)Handles the end of an XML element.voidhandleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)Handles the start of an XML element.voidhandleXMLString(java.lang.String s)Handles a string within an XML element.voidwriteXML(int tab, java.io.Writer writer)Writes the XML representation of this object to file.voidwriteXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar)Writes the XML representation of this object to file, asXMLType.Normal.voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.
-
Method Details
-
getDTD
java.lang.String getDTD()Returns the Data Type Declaration (DTD) for this object's XML representationSee http://en.wikipedia.org/wiki/Document_Type_Definition for a description.
- Returns:
-
getXMLSchema
java.lang.String getXMLSchema()Returns the XML schema for this object's XML representation- Returns:
-
getXML
java.lang.String getXML()Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use thewriteXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater)functions to write larger objects to file.- Returns:
-
getXML
java.lang.String getXML(int tab)Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use thewriteXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater)functions to write larger objects to file.- Parameters:
tab- The number of tabs to place before the opening XML wrapper- Returns:
-
handleXMLElementStart
void handleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type) throws org.xml.sax.SAXExceptionHandles the start of an XML element.- Parameters:
localName- Local name of the elementattributes- Set of element attributestype- TheXMLTypeof this element- Throws:
org.xml.sax.SAXException
-
handleXMLElementEnd
void handleXMLElementEnd(java.lang.String localName) throws org.xml.sax.SAXExceptionHandles the end of an XML element.- Parameters:
localName- Local name of the element- Throws:
org.xml.sax.SAXException
-
handleXMLString
void handleXMLString(java.lang.String s) throws org.xml.sax.SAXExceptionHandles a string within an XML element.- Parameters:
s- String to handle- Throws:
org.xml.sax.SAXException
-
getLocalName
java.lang.String getLocalName()Returns the local name associated with this XML object.- Returns:
-
writeXML
void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionWrites the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format ofXMLFormat.Asciiwill be used.- Parameters:
tab- The number of tabs to place before the XML textwriter- The writeroptions- XMLOutputOptions defining the write parametersprogress_bar- Optional progress updater (may benull)- Throws:
java.io.IOException
-
writeXML
void writeXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar) throws java.io.IOExceptionWrites the XML representation of this object to file, asXMLType.Normal. The default format ofXMLFormat.Asciiwill be used. The basic contract for this method is that it should not write a newline character at its start or end.- Parameters:
tab- The number of tabs to place before the XML textwriter- The writerprogress_bar- Optional progress updater (may benull)- Throws:
java.io.IOException
-
writeXML
void writeXML(int tab, java.io.Writer writer) throws java.io.IOExceptionWrites the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format ofXMLFormat.Asciiwill be used.- Parameters:
tab- The number of tabs to place before the XML textwriter- The writer- Throws:
java.io.IOException
-
getShortXML
java.lang.String getShortXML(int tab)Returns a short XML representation of this object.- Parameters:
tab-- Returns:
-