PACK WOC  $VERSION$
Classes | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
WocClass Class Reference

stores a communication class including serialization and deserialization information More...

#include <procclass.h>

Classes

struct  s_map
 mappings: "table-name" => List of ("column-name","property-name") More...
 
struct  s_prop
 property info More...
 

Public Member Functions

 WocClass (const QDomElement &)
 parses XML to create itself More...
 
bool isValid () const
 returns whether parsing was successful and this instance represents a valid communication class More...
 
QString name () const
 returns the class name More...
 
QString baseClass (QString lang, QString prefix) const
 returns the name of the class it is derived from - default: WObject More...
 
bool hasProperty (QString) const
 returns true of it has a property with this name More...
 
QStringList propertyNames () const
 returns a list of all property names More...
 
QString propertyType (QString) const
 returns the type string of the property, including "List:" if applicable More...
 
QString propertyPlainType (QString) const
 returns the plain type string of the property without "List:" More...
 
bool propertyIsIdentity (QString) const
 returns whether this property identifies the object instance More...
 
bool propertyIsAbstract (QString) const
 returns whether this property is abstract More...
 
bool propertyIsAttribute (QString) const
 returns whether this property is serialized as XML attribute More...
 
bool propertyIsElement (QString) const
 returns whether this property is serialized as XML element More...
 
bool propertyIsSimpleElement (QString) const
 returns whether this property is serialized as XML element, but not a class More...
 
bool propertyIsEnum (QString) const
 returns whether this property has an enum type More...
 
bool propertyIsObject (QString) const
 returns whether the property is an object More...
 
bool propertyIsList (QString) const
 returns whether the property is a list of values (false for scalars) More...
 
bool propertyIsInt (QString p) const
 returns whether the property type is integer More...
 
bool propertyIsBool (QString p) const
 returns whether the property type is boolean More...
 
bool propertyIsString (QString p) const
 returns whether the property type is string More...
 
bool propertyIsBlob (QString p) const
 returns whether the property type is blob More...
 
bool isAbstract (QString) const
 returns whether the class is abstract in the requested language (needs to be customized); it is automatically abstract if any property is abstract More...
 
QStringList abstractLangs () const
 returns the languages in which the class is conditionally abstract More...
 
QStringList enumTypes () const
 returns the names of all enum types of this class More...
 
bool hasEnumType (QString t) const
 returns true if the given enum type exists in this class More...
 
QList< WocEnumenumValues (QString t) const
 returns a list of enum values as name-value pairs More...
 
bool hasMapping (QString m) const
 returns true if the given mapping exists More...
 
QStringList mappingTables () const
 returns the names of all tables for which a mapping exists More...
 
QStringList mappingProperties (QString) const
 returns the (correctly ordered) properties for a mapping More...
 
QMap< QString, QString > mapping (QString m) const
 returns the specific mapping; map key=property, map value=column More...
 
QString mapMethod (QString table, QString property, QString lang) const
 returns the method for a specific mapping or an empty string if it does not exist in the specified language More...
 
QStringList docStrings () const
 returns documentation for this class More...
 
QString propDoc (QString p) const
 returns documentation for a property More...
 
QString enumDoc (QString e) const
 returns base documentation for enums More...
 

Private Attributes

bool m_valid
 valid: parsing the WOLF succeeded More...
 
bool m_abstract
 abstract: the class is declared abstract (isAbstract may return true even if this is false) More...
 
QStringList m_cabstract
 cabstract: conditional abstract - just for one or two languages; abstract overrides cabstract! More...
 
QString m_name
 class name without prefix More...
 
QMap< QString, QString > m_base
 name of parent class ("wolf" => the "base" attributes' content) More...
 
QList< s_propm_props
 
QMap< QString, QList< s_map > > m_maps
 
QMap< QString, QList< WocEnum > > m_enumvals
 enum types: "type-name" => List of ("constant-name",int-constant-value) More...
 
QMap< QString, QString > m_enumdoc
 enum types: "type-name" => "documentation" More...
 
QStringList m_docstrings
 docu of class itself More...
 
QMap< QString, QString > m_propdoc
 docu of properties More...
 

Static Private Attributes

static const QStringList attrtypes =QStringList()<<"astring"<<"int"<<"int32"<<"int64"<<"bool"
 
static const QStringList elemtypes =QStringList()<<"string"<<"blob"
 

Detailed Description

stores a communication class including serialization and deserialization information

Constructor & Destructor Documentation

WocClass::WocClass ( const QDomElement &  cls)

parses XML to create itself

Member Function Documentation

QStringList WocClass::abstractLangs ( ) const
inline

returns the languages in which the class is conditionally abstract

QString WocClass::baseClass ( QString  lang,
QString  prefix 
) const

returns the name of the class it is derived from - default: WObject

Parameters
langthe language for which to return the base class
prefixthe class prefix in the target language
QStringList WocClass::docStrings ( ) const
inline

returns documentation for this class

QString WocClass::enumDoc ( QString  e) const
inline

returns base documentation for enums

QStringList WocClass::enumTypes ( ) const
inline

returns the names of all enum types of this class

QList<WocEnum> WocClass::enumValues ( QString  t) const
inline

returns a list of enum values as name-value pairs

bool WocClass::hasEnumType ( QString  t) const
inline

returns true if the given enum type exists in this class

bool WocClass::hasMapping ( QString  m) const
inline

returns true if the given mapping exists

bool WocClass::hasProperty ( QString  p) const

returns true of it has a property with this name

bool WocClass::isAbstract ( QString  l) const

returns whether the class is abstract in the requested language (needs to be customized); it is automatically abstract if any property is abstract

bool WocClass::isValid ( ) const
inline

returns whether parsing was successful and this instance represents a valid communication class

QString WocClass::mapMethod ( QString  table,
QString  property,
QString  lang 
) const

returns the method for a specific mapping or an empty string if it does not exist in the specified language

QMap< QString, QString > WocClass::mapping ( QString  m) const

returns the specific mapping; map key=property, map value=column

QStringList WocClass::mappingProperties ( QString  m) const

returns the (correctly ordered) properties for a mapping

QStringList WocClass::mappingTables ( ) const
inline

returns the names of all tables for which a mapping exists

QString WocClass::name ( ) const
inline

returns the class name

QString WocClass::propDoc ( QString  p) const
inline

returns documentation for a property

bool WocClass::propertyIsAbstract ( QString  p) const

returns whether this property is abstract

bool WocClass::propertyIsAttribute ( QString  p) const

returns whether this property is serialized as XML attribute

bool WocClass::propertyIsBlob ( QString  p) const
inline

returns whether the property type is blob

bool WocClass::propertyIsBool ( QString  p) const
inline

returns whether the property type is boolean

bool WocClass::propertyIsElement ( QString  p) const

returns whether this property is serialized as XML element

bool WocClass::propertyIsEnum ( QString  p) const

returns whether this property has an enum type

bool WocClass::propertyIsIdentity ( QString  p) const

returns whether this property identifies the object instance

bool WocClass::propertyIsInt ( QString  p) const
inline

returns whether the property type is integer

bool WocClass::propertyIsList ( QString  p) const

returns whether the property is a list of values (false for scalars)

bool WocClass::propertyIsObject ( QString  p) const

returns whether the property is an object

bool WocClass::propertyIsSimpleElement ( QString  p) const

returns whether this property is serialized as XML element, but not a class

bool WocClass::propertyIsString ( QString  p) const
inline

returns whether the property type is string

QStringList WocClass::propertyNames ( ) const

returns a list of all property names

QString WocClass::propertyPlainType ( QString  p) const

returns the plain type string of the property without "List:"

QString WocClass::propertyType ( QString  p) const

returns the type string of the property, including "List:" if applicable

Member Data Documentation

const QStringList WocClass::attrtypes =QStringList()<<"astring"<<"int"<<"int32"<<"int64"<<"bool"
staticprivate
const QStringList WocClass::elemtypes =QStringList()<<"string"<<"blob"
staticprivate
bool WocClass::m_abstract
private

abstract: the class is declared abstract (isAbstract may return true even if this is false)

QMap<QString,QString> WocClass::m_base
private

name of parent class ("wolf" => the "base" attributes' content)

QStringList WocClass::m_cabstract
private

cabstract: conditional abstract - just for one or two languages; abstract overrides cabstract!

QStringList WocClass::m_docstrings
private

docu of class itself

QMap<QString,QString> WocClass::m_enumdoc
private

enum types: "type-name" => "documentation"

QMap<QString,QList<WocEnum> > WocClass::m_enumvals
private

enum types: "type-name" => List of ("constant-name",int-constant-value)

QMap<QString,QList<s_map> > WocClass::m_maps
private
QString WocClass::m_name
private

class name without prefix

QMap<QString,QString> WocClass::m_propdoc
private

docu of properties

QList<s_prop> WocClass::m_props
private
bool WocClass::m_valid
private

valid: parsing the WOLF succeeded


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