Skip to content

Instantly share code, notes, and snippets.

@dacamo76
Created October 28, 2019 05:19
Show Gist options
  • Save dacamo76/5bfb7a42a325dab37de04cefb06bffd5 to your computer and use it in GitHub Desktop.
Save dacamo76/5bfb7a42a325dab37de04cefb06bffd5 to your computer and use it in GitHub Desktop.
final class JSONAttributeRepresentation implements AttributeRepresentation {
private final List<Attribute> attributes;
public JSONAttributeRepresentation(Reader JSONReader) {
// Read in json however you want
// Get name, type, and role for each
// for each create attribute with the name and type
// Attribute att = AttributeFactory.createAttribute(name, type)
// atributes.add(att);
}
@Override
public List<Attribute> newAttributeList() {
List<Attribute> copy = new ArrayList<Attribute>();
for(Attribute attribute: attributes) {
Attribute att = AttributeFactory.createAttribute(attribute.getName(),
attribute.getValueType());
copy.add(att);
}
return copy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment