diff options
author | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-07-11 14:53:14 +0200 |
---|---|---|
committer | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-07-11 14:53:14 +0200 |
commit | b7fed6c334740f724734e6ec1e4ec3f4def4b946 (patch) | |
tree | d9ac97b09779dd76f93595f62a07a67cb8875d10 | |
parent | 8e5cb70525bc6506c67ad9d9380367b546003ce6 (diff) |
update the API documentation
-rw-r--r-- | qface/idl/domain.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/qface/idl/domain.py b/qface/idl/domain.py index 6c893da..327472e 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -125,6 +125,7 @@ class Symbol(NamedElement): self._contentMap = ChainMap() self.type = TypeSymbol('', self) + """ the associated type information """ @property def system(self): @@ -136,23 +137,28 @@ class Symbol(NamedElement): return self._tags def add_tag(self, tag): + """ add a tag to the tag list """ if tag not in self._tags: self._tags[tag] = dict() def add_attribute(self, tag, name, value): + """ add an attribute (nam, value pair) to the named tag """ self.add_tag(tag) d = self._tags[tag] d[name] = value def tag(self, name): + """ return tag by name """ return self._tags[name] def attribute(self, tag, name): + """ return attribute by tag and attribute name """ if tag in self._tags and name in self._tags[tag]: return self._tags[tag][name] @property def contents(self): + """ return general list of symbol contents """ return self._contentMap.values() def toJson(self): @@ -168,11 +174,17 @@ class TypeSymbol(NamedElement): super().__init__(name, parent.module) log.debug('TypeSymbol()') self.parent = parent + """ the parent symbol of this type """ self.is_void = False # type:bool + """ if type represents the void type """ self.is_primitive = False # type:bool + """ if type represents a primitive type """ self.is_complex = False # type:bool + """ if type represents a complex type """ self.is_list = False # type:bool + """ if type represents a list of nested types """ self.is_model = False # type:bool + """ if type represents a model of nested types """ self.nested = None """nested type if symbol is list or model""" self.__reference = None @@ -242,6 +254,7 @@ class TypeSymbol(NamedElement): @property def type(self): + """ return the type information. In this case: self """ return self def toJson(self): @@ -311,14 +324,17 @@ class Module(Symbol): @property def majorVersion(self): + """ returns the major version number of the version information """ return self.version.split('.')[0] @property def minorVersion(self): + """ returns the minor version number of the version information """ return self.version.split('.')[1] @property def module_name(self): + """ returns a capitalized name from the module name """ return self.name.split('.')[-1].capitalize() def lookup(self, name: str, fragment: str = None): @@ -369,6 +385,7 @@ class Interface(Symbol): @property def extends(self): + ''' returns the symbol defined by the extends interface attribute ''' return self.module.lookup(self._extends) def toJson(self): @@ -385,8 +402,11 @@ class Operation(Symbol): super().__init__(name, interface.module) log.debug('Operation()') self.interface = interface + """ the interface the operation is part of """ self.interface._operationMap[name] = self self._parameterMap = self._contentMap = OrderedDict() # type: dict[Parameter] + self.is_const = False #type: bool + """reflects is the operation was declared as const operation""" @property def qualified_name(self): @@ -450,14 +470,17 @@ class Property(Symbol): @property def is_model(self): + ''' true if type is a model ''' return self.type.is_model @property def is_primitive_model(self): + ''' true if type is a model of nested primitive types ''' return self.type.is_model and self.type.nested.is_primitive @property def is_complex_model(self): + ''' true if type is a model of nested complex types ''' return self.type.is_model and self.type.nested.is_complex @property @@ -465,7 +488,6 @@ class Property(Symbol): '''return the fully qualified name (`<module>.<interface>#<property>`)''' return '{0}.{1}#{2}'.format(self.module.name, self.interface.name, self.name) - def toJson(self): o = super().toJson() if self.readonly: |