public Argument addField(String name, ArgumentListStatus listStatus) throws FHIRException { Argument result = null; for (Argument t : fields) if ((t.name.equals(name))) result = t; if (result == null) { result = new Argument(); result.setName(name); result.setListStatus(listStatus); fields.add(result); } else if (result.getListStatus() == ArgumentListStatus.SINGLETON) throw new FHIRException("Error: Attempt to make '+name+' into a repeating field when it is constrained by @singleton"); else result.setListStatus(ArgumentListStatus.REPEATING); return result; }
private Argument parseArgument() throws EGraphQLException, IOException { Argument result = new Argument(); result.setName(consumeName()); consumePunctuation(":"); if (hasPunctuation("[")) { result.setListStatus(ArgumentListStatus.REPEATING); consumePunctuation("["); while (!hasPunctuation("]")) result.getValues().add(parseValue()); consumePunctuation("]"); } else result.getValues().add(parseValue()); return result; }
public Argument addField(String name, ArgumentListStatus listStatus) throws FHIRException { Argument result = null; for (Argument t : fields) if ((t.name.equals(name))) result = t; if (result == null) { result = new Argument(); result.setName(name); result.setListStatus(listStatus); fields.add(result); } else if (result.getListStatus() == ArgumentListStatus.SINGLETON) throw new FHIRException("Error: Attempt to make '+name+' into a repeating field when it is constrained by @singleton"); else result.setListStatus(ArgumentListStatus.REPEATING); return result; }
private Argument parseArgument() throws EGraphQLException, IOException { Argument result = new Argument(); result.setName(consumeName()); consumePunctuation(":"); if (hasPunctuation("[")) { result.setListStatus(ArgumentListStatus.REPEATING); consumePunctuation("["); while (!hasPunctuation("]")) result.getValues().add(parseValue()); consumePunctuation("]"); } else result.getValues().add(parseValue()); return result; }