sptk2 logo
SPTK Home Page
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
sptk::WSComplexType Class Reference

#include <WSComplexType.h>

Inheritance diagram for sptk::WSComplexType:
sptk::WSType

Public Member Functions

 WSComplexType (const char *name, bool optional=false)
 
 WSComplexType (const WSComplexType &other)=default
 
 WSComplexType (WSComplexType &&other) noexcept=default
 
 ~WSComplexType () override=default
 
WSComplexTypeoperator= (const WSComplexType &other)=default
 
WSComplexTypeoperator= (WSComplexType &&other) noexcept=default
 
String className () const override
 
void clear () override
 
void copyFrom (const WSComplexType &other)
 
void load (const xdoc::SNode &input, bool nullLargeData=false) override
 
virtual void load (const sptk::FieldList &input, bool nullLargeData=false)
 
virtual void unload (const xdoc::SNode &output) const
 
virtual void unload (QueryParameterList &output) const
 
void exportTo (const xdoc::SNode &parent, const char *name=nullptr) const override
 
bool isNull () const override
 
virtual bool isOptional () const
 
virtual String toString (bool asJSON=true, bool formatted=false) const
 
void throwIfNull (const String &parentTypeName) const
 
void exportable (bool flag)
 
- Public Member Functions inherited from sptk::WSType
 WSType ()=default
 
 WSType (const char *name)
 
 WSType (const WSType &)=default
 
 WSType (WSType &&) noexcept=default
 
WSTypeoperator= (const WSType &)
 
WSTypeoperator= (WSType &&) noexcept
 
virtual String className () const
 
virtual String name () const
 
virtual void owaspCheck (const String &value)
 
virtual void clear ()=0
 
virtual void load (const xdoc::SNode &attr, bool nullLargeData=false)=0
 
virtual String asString () const
 
virtual bool isNull () const =0
 
virtual void exportTo (const xdoc::SNode &parent, const char *name=nullptr) const =0
 

Static Public Member Functions

static void unload (QueryParameterList &output, const char *paramName, const WSBasicType *elementOrAttribute)
 

Protected Member Functions

bool loaded () const
 
void setLoaded (bool flag)
 
virtual void _clear ()
 
const WSFieldIndexgetFields () const
 
void setElements (const Strings &fieldNames, std::initializer_list< WSType * > fields)
 
void setAttributes (const Strings &fieldNames, std::initializer_list< WSType * > fields)
 
virtual void checkRestrictions () const
 

Detailed Description

Base type for all user WSDL types

Constructor & Destructor Documentation

◆ WSComplexType() [1/3]

sptk::WSComplexType::WSComplexType ( const char *  name,
bool  optional = false 
)
inline

Default constructor

Parameters
nameElement name
optionalElement optionality flag

◆ WSComplexType() [2/3]

sptk::WSComplexType::WSComplexType ( const WSComplexType other)
default

Copy constructor

Parameters
otherOther object

◆ WSComplexType() [3/3]

sptk::WSComplexType::WSComplexType ( WSComplexType &&  other)
defaultnoexcept

Move constructor

Parameters
otherOther object

◆ ~WSComplexType()

sptk::WSComplexType::~WSComplexType ( )
overridedefault

Destructor

Member Function Documentation

◆ _clear()

virtual void sptk::WSComplexType::_clear ( )
inlineprotectedvirtual

Internal clear data

References sptk::WSType::clear().

◆ checkRestrictions()

virtual void sptk::WSComplexType::checkRestrictions ( ) const
inlineprotectedvirtual

Optional checking for restrictions

◆ className()

String sptk::WSComplexType::className ( ) const
inlineoverridevirtual

Return class name

Reimplemented from sptk::WSType.

◆ clear()

void sptk::WSComplexType::clear ( )
inlineoverridevirtual

Clear content and releases allocated memory

Implements sptk::WSType.

◆ copyFrom()

void sptk::WSComplexType::copyFrom ( const WSComplexType other)

Copy data from other object

Parameters
otherObject to copy from

◆ exportable()

void sptk::WSComplexType::exportable ( bool  flag)
inline

If object is exportable, it's included during export to JSON or XML

Parameters
flagExportable flag

◆ exportTo()

void sptk::WSComplexType::exportTo ( const xdoc::SNode &  parent,
const char *  name = nullptr 
) const
overridevirtual

Unload data to new XML node

Parameters
parentParent XML node where new node is created
nameOptional name for the child element

Implements sptk::WSType.

◆ isNull()

bool sptk::WSComplexType::isNull ( ) const
overridevirtual

True if data was not loaded, or if all the fields are null.

Implements sptk::WSType.

◆ isOptional()

virtual bool sptk::WSComplexType::isOptional ( ) const
inlinevirtual

True is element is optional

◆ load() [1/2]

virtual void sptk::WSComplexType::load ( const sptk::FieldList input,
bool  nullLargeData = false 
)
virtual

Load data from FieldList

Only simple WSDL type members are loaded.

Parameters
inputQuery field list containing CMqType data
nullLargeDataSet null for elements with data size > 256 bytes

◆ load() [2/2]

void sptk::WSComplexType::load ( const xdoc::SNode &  input,
bool  nullLargeData = false 
)
overridevirtual

Loads type data from request XML node

Parameters
inputXML node
nullLargeDataSet null for elements with data size > 256 bytes

Implements sptk::WSType.

◆ loaded()

bool sptk::WSComplexType::loaded ( ) const
inlineprotected
Returns
true if object is loaded

◆ operator=() [1/2]

WSComplexType & sptk::WSComplexType::operator= ( const WSComplexType other)
default

Copy assignment

Parameters
otherOther object

◆ operator=() [2/2]

WSComplexType & sptk::WSComplexType::operator= ( WSComplexType &&  other)
defaultnoexcept

Move assignment

Parameters
otherOther object

◆ setLoaded()

void sptk::WSComplexType::setLoaded ( bool  flag)
inlineprotected

Set loaded flag

Parameters
flagIf true then object is loaded

◆ throwIfNull()

void sptk::WSComplexType::throwIfNull ( const String parentTypeName) const

Throw SOAPException is the object is null

Parameters
parentTypeNameParent object type name

◆ toString()

virtual String sptk::WSComplexType::toString ( bool  asJSON = true,
bool  formatted = false 
) const
virtual

Print element as XML text

Parameters
asJSONOutput is JSON (true) or XML (false)
Returns
object presentation as JSON or XML string

◆ unload() [1/3]

virtual void sptk::WSComplexType::unload ( const xdoc::SNode &  output) const
virtual

Unload data to existing XML node

Parameters
outputExisting XML node

◆ unload() [2/3]

virtual void sptk::WSComplexType::unload ( QueryParameterList output) const
virtual

Unload data to Query's parameters

Parameters
outputQuery parameters

◆ unload() [3/3]

static void sptk::WSComplexType::unload ( QueryParameterList output,
const char *  paramName,
const WSBasicType elementOrAttribute 
)
static

Unload single element or attribute to DB query parameter

Parameters
outputQuery parameters
paramNameQuermy parameter name
elementOrAttributeComplex type element (not an array!)

The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:47: SPTK 5.4.1