fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
JetBrains.Annotations.ContractAnnotationAttribute Class Reference

Describes dependency between method input and output More...

+ Inheritance diagram for JetBrains.Annotations.ContractAnnotationAttribute:
+ Collaboration diagram for JetBrains.Annotations.ContractAnnotationAttribute:

Public Member Functions

 ContractAnnotationAttribute ([NotNull] string fdt)
 
 ContractAnnotationAttribute ([NotNull] string fdt, bool forceFullStates)
 

Properties

string FDT [get, set]
 
bool ForceFullStates [get, set]
 

Detailed Description

Describes dependency between method input and output

<syntax>

Function definition table syntax:

  • FDT ::= FDTRow [;FDTRow]*
  • FDTRow ::= Input => Output | Output <= Input
  • Input ::= ParameterName: Value [, Input]*
  • Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}
  • Value ::= true | false | null | notnull | canbenull

If method has single input parameter, it's name could be omitted.
Using "halt" (or "void"/"nothing", which is the same) for method output means that methos doesn't return normally.
"canbenull" annotation is only applicable for output parameters.
You can use multiple [ContractAnnotation] for each FDT row, or use single attribute with rows separated by semicolon.
</syntax> <examples>

  • [ContractAnnotation("=> halt")] public void TerminationMethod()
  • [ContractAnnotation("halt &lt;= condition: false")] public void Assert(bool condition, string text) // Regular Assertion method
  • [ContractAnnotation("s:null => true")] public bool IsNullOrEmpty(string s) // String.IsNullOrEmpty
  • [ContractAnnotation("null => null; notnull => notnull")] public object Transform(object data) // Method which returns null if parameter is null, and not null if parameter is not null
  • [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] public bool TryParse(string s, out Person result)

</examples>

Constructor & Destructor Documentation

JetBrains.Annotations.ContractAnnotationAttribute.ContractAnnotationAttribute ( [NotNull] string  fdt)
JetBrains.Annotations.ContractAnnotationAttribute.ContractAnnotationAttribute ( [NotNull] string  fdt,
bool  forceFullStates 
)

Property Documentation

string JetBrains.Annotations.ContractAnnotationAttribute.FDT
getset
bool JetBrains.Annotations.ContractAnnotationAttribute.ForceFullStates
getset

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