protected void writeVarDef( IVarDef varDef)
    {
    Stream<VarValueDef> values =
      varDef.getValues() == null
      ? null
      : toStream( varDef.getValues());

    Stream<IVarDef> members = 
      varDef.getMembers() == null
      ? null
      : toStream( varDef.getMembers());

    String varTag =
      members == null
      ? VAR_TAG
      : VARSET_TAG;

    ConditionWriter conditionWriter = new ConditionWriter( varDef.getCondition());

    xmlWriter_
      .element( varTag)
      .attribute( NAME_ATR, varDef.getName())
      .attributeIf( WHEN_ATR, conditionWriter.getWhenAttribute())
      .content( () ->
        {
        writeAnnotations( varDef);
        conditionWriter.writeWhenElement();
        if( varTag.equals( VAR_TAG))
          {
          values.forEach( this::writeValue);
          }
        else
          {
          members.forEach( this::writeVarDef);
          }
        })
      .write();
    }
protected void writeVarDef ( IVarDef varDef ) { Stream < VarValueDef > values = varDef . getValues ( ) == null ? null : toStream ( varDef . getValues ( ) ) ; Stream < IVarDef > members = varDef . getMembers ( ) == null ? null : toStream ( varDef . getMembers ( ) ) ; String varTag = members == null ? VAR_TAG : VARSET_TAG ; ConditionWriter conditionWriter = new ConditionWriter ( varDef . getCondition ( ) ) ; xmlWriter_ . element ( varTag ) . attribute ( NAME_ATR , varDef . getName ( ) ) . attributeIf ( WHEN_ATR , conditionWriter . getWhenAttribute ( ) ) . content ( ( ) -> { writeAnnotations ( varDef ) ; conditionWriter . writeWhenElement ( ) ; if ( varTag . equals ( VAR_TAG ) ) { values . forEach ( this :: writeValue ) ; } else { members . forEach ( this :: writeVarDef ) ; } } ) . write ( ) ; }
Writes the given variable definition.