private static Stream < IVarDef > getVarDefs ( String varType , JsonObject json ) { try { // Get annotations for this group of variables Annotated groupAnnotations = new Annotated ( ) { } ; Optional . ofNullable ( json . getJsonObject ( HAS_KEY ) ) . ifPresent ( has -> has . keySet ( ) . stream ( ) . forEach ( key -> groupAnnotations . setAnnotation ( key , has . getString ( key ) ) ) ) ; // Return variables for this variable type. return json . keySet ( ) . stream ( ) . filter ( key -> ! key . equals ( HAS_KEY ) ) . map ( varName -> asVarDef ( varName , varType , groupAnnotations , json . getJsonObject ( varName ) ) ) ; } catch ( SystemInputException e ) { throw new SystemInputException ( String . format ( "Error defining variables of type=%s" , varType ) , e ) ; } }
Returns the variable definitions represented by the given JSON object .