FDO .NET API Reference | Feature Data Objects |
00001 /* 00002 * Copyright (C) 2004-2006 Autodesk, Inc. 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of version 2.1 of the GNU Lesser 00006 * General Public License as published by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Lesser General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public 00014 * License along with this library; if not, write to the Free Software 00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00016 * 00017 */ 00018 00019 #pragma once 00020 00021 class FdoXmlFeatureHandler; 00022 00023 BEGIN_NAMESPACE_OSGEO_FDO_RASTER 00024 public __gc __interface IRaster; 00025 END_NAMESPACE_OSGEO_FDO_RASTER 00026 00027 BEGIN_NAMESPACE_OSGEO_FDO_SCHEMA 00028 public __gc class ClassDefinition; 00029 END_NAMESPACE_OSGEO_FDO_SCHEMA 00030 00031 BEGIN_NAMESPACE_OSGEO_FDO_XML 00032 public __gc class XmlFeatureContext; 00033 00034 /// \ingroup (OSGeoFDOXml) 00035 /// \brief 00036 /// XmlFeatureHandler defines the callback interface for reading features from XML. 00037 /// It is not an interface in the strict sense, since each function has a default 00038 /// implementation that does nothing. Implementors can override these callbacks to 00039 /// customize the handling of feature fragments parsed by XmlFeaturePropertyReader. 00040 /// Note that the default FeatureProperty implementations log errors in certain circumstances. 00041 /// Therefore, these functions must be overridden to avoid these errors and indicate that 00042 /// these types of properties are being handled by the caller. 00043 public __gc class XmlFeatureHandler : public NAMESPACE_OSGEO_RUNTIME::Disposable 00044 { 00045 public: 00046 /// \brief 00047 /// Default feature handler callback that is called when the 00048 /// XmlFeaturePropertyReader starts reading an XML document. Does nothing. 00049 /// 00050 /// \param context 00051 /// Input caller specified contextual information 00052 /// 00053 /// \return 00054 /// Returns the feature Handler for all sub-elements of the element that was current 00055 /// when the read started. If NULL, this feature handler remains in effect. 00056 /// 00057 NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* FeatureDocumentStart(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00058 00059 /// \brief 00060 /// Default feature handler callback that is called when the XmlFeaturePropertyReader 00061 /// finishes reading an XML document. Does nothing 00062 /// 00063 /// \param context 00064 /// Input caller specified contextual information 00065 /// 00066 System::Void FeatureDocumentEnd(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00067 00068 /// \brief 00069 /// Default feature handler callback that is called when the 00070 /// XmlFeaturePropertyReader encounters the start of a feature collection. 00071 /// Does nothing. 00072 /// 00073 /// \param context 00074 /// Input caller specified contextual information 00075 /// \param definition 00076 /// Input definition containing feature class name, schema name, valid property list, 00077 /// etc. 00078 /// 00079 /// \return 00080 /// Returns the feature Handler for the features in this collection. 00081 /// If NULL, this feature handler remains in effect. 00082 /// 00083 NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* FeatureCollectionStart(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* definition); 00084 00085 /// \brief 00086 /// Default feature handler callback that is called when the 00087 /// XmlFeaturePropertyReader encounters the end of a feature collection. 00088 /// Does nothing 00089 /// 00090 /// \param context 00091 /// Input caller specified contextual information 00092 /// 00093 /// \return 00094 /// Returning true causes the current parse to stop. Returning false causes the parse 00095 /// to continue. Return value is ignored if the current parse is not an incremental 00096 /// parse ( see XmlFeaturePropertyReader::Parse()) 00097 /// 00098 System::Boolean FeatureCollectionEnd(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00099 00100 /// \brief 00101 /// Default feature handler callback that is called when the 00102 /// XmlFeaturePropertyReader encounters the start of a feature. Does nothing. 00103 /// 00104 /// \param context 00105 /// Input caller specified contextual information 00106 /// \param definition 00107 /// Input definition containing feature class name, schema name, valid property list, 00108 /// etc. 00109 /// 00110 /// \return 00111 /// Returns the feature Handler for the feature's properties. If NULL, this feature 00112 /// handler remains in effect. 00113 /// 00114 NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* FeatureStart(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* definition); 00115 00116 /// \brief 00117 /// Default feature handler callback that is called when the 00118 /// XmlFeaturePropertyReader encounters the end of a feature. Does nothing. 00119 /// 00120 /// \param context 00121 /// Input caller specified contextual information 00122 /// 00123 /// \return 00124 /// Returning true causes the current parse to stop. Returning false causes the 00125 /// parse to continue. Return value is ignored if the current parse is not an 00126 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00127 /// 00128 System::Boolean FeatureEnd(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00129 00130 /// \brief 00131 /// Default feature handler callback that is called when the 00132 /// XmlFeaturePropertyReader encounters a property with boolean value. 00133 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00134 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00135 /// 00136 /// \param context 00137 /// Input caller specified contextual information 00138 /// \param name 00139 /// Input property name 00140 /// \param value 00141 /// Input property value 00142 /// 00143 /// \return 00144 /// Returning true causes the current parse to stop. Returning false causes 00145 /// the parse to continue. Return value is ignored if the current parse is not an 00146 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00147 /// 00148 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Boolean value); 00149 00150 /// \brief 00151 /// Default feature handler callback that is called when the 00152 /// XmlFeaturePropertyReader encounters a property with single byte value. 00153 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00154 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00155 /// 00156 /// \param context 00157 /// Input caller specified contextual information 00158 /// \param name 00159 /// Input property name 00160 /// \param value 00161 /// Input property value 00162 /// 00163 /// \return 00164 /// Returning true causes the current parse to stop. Returning false causes 00165 /// the parse to continue. Return value is ignored if the current parse is not an 00166 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00167 /// 00168 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Byte value); 00169 00170 /// \brief 00171 /// Default feature handler callback that is called when the 00172 /// XmlFeaturePropertyReader encounters a property with DataTime value. 00173 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00174 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00175 /// 00176 /// \param context 00177 /// Input caller specified contextual information 00178 /// \param name 00179 /// Input property name 00180 /// \param value 00181 /// Input property value 00182 /// 00183 /// \return 00184 /// Returning true causes the current parse to stop. Returning false causes 00185 /// the parse to continue. Return value is ignored if the current parse is not an 00186 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00187 /// 00188 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::DateTime value); 00189 00190 /// \brief 00191 /// Default feature handler callback that is called when the 00192 /// XmlFeaturePropertyReader encounters a property with double value. 00193 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00194 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00195 /// 00196 /// \param context 00197 /// Input caller specified contextual information 00198 /// \param name 00199 /// Input property name 00200 /// \param value 00201 /// Input property value 00202 /// 00203 /// \return 00204 /// Returning true causes the current parse to stop. Returning false causes 00205 /// the parse to continue. Return value is ignored if the current parse is not an 00206 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00207 /// 00208 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Double value); 00209 00210 /// \brief 00211 /// Default feature handler callback that is called when the 00212 /// XmlFeaturePropertyReader encounters a property with int16 value. 00213 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00214 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00215 /// 00216 /// \param context 00217 /// Input caller specified contextual information 00218 /// \param name 00219 /// Input property name 00220 /// \param value 00221 /// Input property value 00222 /// 00223 /// \return 00224 /// Returning true causes the current parse to stop. Returning false causes 00225 /// the parse to continue. Return value is ignored if the current parse is not an 00226 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00227 /// 00228 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Int16 value); 00229 00230 /// \brief 00231 /// Default feature handler callback that is called when the 00232 /// XmlFeaturePropertyReader encounters a property with int32 value. 00233 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00234 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00235 /// 00236 /// \param context 00237 /// Input caller specified contextual information 00238 /// \param name 00239 /// Input property name 00240 /// \param value 00241 /// Input property value 00242 /// 00243 /// \return 00244 /// Returning true causes the current parse to stop. Returning false causes 00245 /// the parse to continue. Return value is ignored if the current parse is not an 00246 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00247 /// 00248 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Int32 value); 00249 00250 /// \brief 00251 /// Default feature handler callback that is called when the 00252 /// XmlFeaturePropertyReader encounters a property with int64 value. 00253 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00254 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00255 /// 00256 /// \param context 00257 /// Input caller specified contextual information 00258 /// \param name 00259 /// Input property name 00260 /// \param value 00261 /// Input property value 00262 /// 00263 /// \return 00264 /// Returning true causes the current parse to stop. Returning false causes 00265 /// the parse to continue. Return value is ignored if the current parse is not an 00266 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00267 /// 00268 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Int64 value); 00269 00270 /// \brief 00271 /// Default feature handler callback that is called when the 00272 /// XmlFeaturePropertyReader encounters a property with single precision value. 00273 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00274 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00275 /// 00276 /// \param context 00277 /// Input caller specified contextual information 00278 /// \param name 00279 /// Input property name 00280 /// \param value 00281 /// Input property value 00282 /// 00283 /// \return 00284 /// Returning true causes the current parse to stop. Returning false causes 00285 /// the parse to continue. Return value is ignored if the current parse is not an 00286 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00287 /// 00288 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Single value); 00289 00290 /// \brief 00291 /// Default feature handler callback that is called when the 00292 /// XmlFeaturePropertyReader encounters a property with string value. 00293 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00294 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00295 /// 00296 /// \param context 00297 /// Input caller specified contextual information 00298 /// \param name 00299 /// Input property name 00300 /// \param value 00301 /// Input property value 00302 /// 00303 /// \return 00304 /// Returning true causes the current parse to stop. Returning false causes 00305 /// the parse to continue. Return value is ignored if the current parse is not an 00306 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00307 /// 00308 System::Boolean FeatureProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::String* value); 00309 00310 /// \brief 00311 /// Default feature handler callback that is called when the 00312 /// XmlFeaturePropertyReader encounters the start of a raster property. 00313 /// Logs an error when the current ErrorLevel is High or Normal. An error is 00314 /// also logged when the ErrorLevel is Low and the current property is not nullable. 00315 /// The raster image is sent by subsequent calls to FeatureBinaryData(). 00316 /// 00317 /// \param context 00318 /// Input caller specified contextual information 00319 /// \param name 00320 /// Input property name 00321 /// \param value 00322 /// Input raster image properties. This object always has a NULL stream reader. The image is 00323 /// handled by the FeatureBinaryData() callback. 00324 /// 00325 /// \return 00326 /// Returning true causes the current parse to stop. Returning false causes the 00327 /// parse to continue. Return value is ignored if the current parse is not an 00328 /// incremental parse ( see XmlFeaturePropertyReader::Parse()) 00329 /// 00330 System::Boolean FeatureStartRasterProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, NAMESPACE_OSGEO_FDO_RASTER::IRaster* value); 00331 00332 /// \brief 00333 /// Default feature handler callback that is called when the 00334 /// XmlFeaturePropertyReader encounters the end of a raster property. 00335 /// Does nothing 00336 /// 00337 /// \param context 00338 /// Input caller specified contextual information 00339 /// 00340 /// \return 00341 /// Returning true causes the current parse to stop. Returning false causes the parse 00342 /// to continue. Return value is ignored if the current parse is not an incremental 00343 /// parse ( see XmlFeaturePropertyReader::Parse()) 00344 /// 00345 System::Boolean FeatureEndRasterProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00346 00347 /// \brief 00348 /// Default feature handler callback that is called when the 00349 /// XmlFeaturePropertyReader encounters the start of a lob property. 00350 /// Logs an error when the current ErrorLevel is High or Normal. 00351 /// If this is a BLOB property then its value is sent through the FeatureBinaryData() callback. 00352 /// If this is a CLOB property then its value is sent through the FeatureCharacters() callback. 00353 /// 00354 /// \param context 00355 /// Input caller specified contextual information 00356 /// \param name 00357 /// Input property name 00358 /// 00359 /// \return 00360 /// Returning true causes the current parse to stop. Returning false cause the parse 00361 /// to continue. Return value is ignored if the current parse is not an incremental 00362 /// parse ( see XmlFeaturePropertyReader::Parse()) 00363 /// 00364 System::Boolean FeatureStartLobProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name); 00365 00366 /// \brief 00367 /// Default feature handler callback that is called when the 00368 /// XmlFeaturePropertyReader encounters the end of a lob property. 00369 /// Does nothing 00370 /// 00371 /// \param context 00372 /// Input caller specified contextual information 00373 /// 00374 /// \return 00375 /// Returning true causes the current parse to stop. Returning false causes the parse 00376 /// to continue. Return value is ignored if the current parse is not an incremental 00377 /// parse ( see XmlFeaturePropertyReader::Parse()) 00378 /// 00379 System::Boolean FeatureEndLobProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00380 00381 /// \brief 00382 /// Default feature handler callback that is called when the 00383 /// XmlFeaturePropertyReader encounters a geometric property. 00384 /// Logs an error when the current ErrorLevel is High or Normal. 00385 /// 00386 /// \param context 00387 /// Input caller specified contextual information 00388 /// \param name 00389 /// Input property name 00390 /// \param buffer 00391 /// Input pointer to the byte array defining the geometry value 00392 /// 00393 /// \return 00394 /// Returning true causes the current parse to stop. Returning false causes the parse 00395 /// continue. Return value is ignored if the current parse is not an incremental 00396 /// parse ( see XmlFeaturePropertyReader::Parse()) 00397 /// 00398 System::Boolean FeatureGeometricProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, System::Byte buffer[]); 00399 00400 /// \brief 00401 /// Default feature handler callback that is called when the 00402 /// XmlFeaturePropertyReader encounters the start of an object property. 00403 /// Does nothing. 00404 /// 00405 /// \param context 00406 /// Input caller specified contextual information 00407 /// \param name 00408 /// Input object property name 00409 /// \param value 00410 /// Input definition for the object property's class. 00411 /// 00412 /// \return 00413 /// Returns the feature Handler for the current object property's sub-properties. 00414 /// If NULL, this feature handler remains in effect. 00415 /// 00416 NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* FeatureStartObjectProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* value); 00417 00418 /// \brief 00419 /// Default feature handler callback that is called when the 00420 /// XmlFeaturePropertyReader encounters the end of an object property. 00421 /// Does nothing 00422 /// 00423 /// \param context 00424 /// Input caller specified contextual information 00425 /// 00426 /// \return 00427 /// Returning true causes the current parse to stop. Returning false causes the parse 00428 /// to continue. Return value is ignored if the current parse is not an incremental 00429 /// parse ( see XmlFeaturePropertyReader::Parse()) 00430 /// 00431 System::Boolean FeatureEndObjectProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00432 00433 /// \brief 00434 /// Default feature handler callback that is called when the 00435 /// XmlFeaturePropertyReader encounters the start of an association property. 00436 /// Does nothing by default. 00437 /// A number of other events are fired between FeatureStartAssociationProperty 00438 /// and FeatureEndAssociationProperty, to identify the associated feature 00439 /// referenced by the current association property: 00440 /// <ul> 00441 /// <li> if the associated feature is specified by an xlink:href, then 00442 /// the href value is sent through a single FeatureProperty event. 00443 /// The property is named "gml/id". 00444 /// <li> if the associated feature is specified by its identity property 00445 /// values, then a FeatureProperty event is fired for each identity 00446 /// property value. 00447 /// <li> if the associated feature is inline (specified by a sub-element of 00448 /// current association property) then a set of FeatureStart, 00449 /// FeatureProperty, and FeatureEnd events are fired. 00450 /// </ul> 00451 /// 00452 /// \param context 00453 /// Input caller specified contextual information 00454 /// \param name 00455 /// Input association property name 00456 /// \param value 00457 /// Input definition for the association property's 00458 /// associated class. 00459 /// 00460 /// \return 00461 /// Returns the feature Handler for the current association property's sub-properties. 00462 /// If NULL, this feature handler remains in effect. 00463 /// 00464 NAMESPACE_OSGEO_FDO_XML::XmlFeatureHandler* FeatureStartAssociationProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* name, NAMESPACE_OSGEO_FDO_SCHEMA::ClassDefinition* value); 00465 00466 /// \brief 00467 /// Default feature handler callback that is called when the 00468 /// XmlFeaturePropertyReader encounters the end of an association property. 00469 /// Does nothing 00470 /// 00471 /// \param context 00472 /// Input caller specified contextual information 00473 /// 00474 /// \return 00475 /// Returning true causes the current parse to stop. Returning false causes the parse 00476 /// to continue. Return value is ignored if the current parse is not an incremental 00477 /// parse ( see XmlFeaturePropertyReader::Parse()) 00478 /// 00479 System::Boolean FeatureEndAssociationProperty(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context); 00480 00481 /// \brief 00482 /// Default Feature Handle callback that is called when the XmlFeaturePropertyReader 00483 /// reads a chunk of data for a CLOB property. Does nothing by default. 00484 /// This function may be called multiple times for the same property, if the 00485 /// the property value is large. Applications must not make any assumptions about the 00486 /// chunk size or number of chunks for each property. 00487 /// 00488 /// \param context 00489 /// Input caller specified contextual information 00490 /// \param value 00491 /// Input the next chunk of simple content 00492 /// 00493 /// \return 00494 /// Returning true causes the current parse to stop. Returning false causes the parse 00495 /// to continue. Return value is ignored if the current parse is not an incremental 00496 /// parse ( see XmlFeaturePropertyReader::Parse()) 00497 /// 00498 System::Boolean FeatureCharacters(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::String* value); 00499 00500 /// \brief 00501 /// Default Feature callback that is called when the XmlFeaturePropertyReader 00502 /// reads a chunk of data for a Raster or BLOB property. 00503 /// Does nothing by default. 00504 /// This function may be called multiple times for the same property, if the 00505 /// the property value is large. Applications must not make any assumptions about the 00506 /// chunk size or number of chunks for each property. 00507 /// 00508 /// \param context 00509 /// Input caller specified contextual information 00510 /// \param buffer 00511 /// Input the next chunk of binary content in unencoded form. An exception is thrown 00512 /// if the content cannot be decoded. 00513 /// 00514 /// \return 00515 /// Returning true causes the current parse to stop. Returning false causes the parse 00516 /// to continue. Return value is ignored if the current parse is not an incremental 00517 /// parse ( see XmlFeaturePropertyReader::Parse()) 00518 /// 00519 System::Boolean FeatureBinaryData(NAMESPACE_OSGEO_FDO_XML::XmlFeatureContext* context, System::Byte buffer[]); 00520 00521 public private: 00522 XmlFeatureHandler(System::IntPtr unmanaged, System::Boolean autoDelete); 00523 00524 inline FdoXmlFeatureHandler* GetImpObj(); 00525 00526 /// \cond DOXYGEN-IGNORE 00527 protected: 00528 System::Void ReleaseUnmanagedObject(); 00529 /// \endcond 00530 }; 00531 00532 END_NAMESPACE_OSGEO_FDO_XML 00533 00534
Comments or suggestions? Send us feedback. |