Created
October 28, 2019 05:19
-
-
Save dacamo76/5bfb7a42a325dab37de04cefb06bffd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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