@Override public Array<Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { Array<Object> result = JSCollections.$array(); return deserialize(jp, ctxt, result); }
public PapDependencyDefinitions() { dependencyDefinitionMap = JSCollections.$map(); }
s = JSCollections.$castArray(query.split("\\")).join("\\\\"); s = JSCollections.$castArray(s.split("-")).join("\\-"); s = JSCollections.$castArray(s.split("=")).join("\\="); s = JSCollections.$castArray(s.split("&&")).join("\\&&"); s = JSCollections.$castArray(s.split("||")).join("\\||"); s = JSCollections.$castArray(s.split("<")).join("\\<"); s = JSCollections.$castArray(s.split(">")).join("\\>"); s = JSCollections.$castArray(s.split("|")).join("\\|"); s = JSCollections.$castArray(s.split("(")).join("\\("); s = JSCollections.$castArray(s.split(")")).join("\\)"); s = JSCollections.$castArray(s.split("{")).join("\\{"); s = JSCollections.$castArray(s.split("}")).join("\\}"); s = JSCollections.$castArray(s.split("[")).join("\\["); s = JSCollections.$castArray(s.split("]")).join("\\]"); s = JSCollections.$castArray(s.split("^")).join("\\^"); s = JSCollections.$castArray(s.split("\"")).join("\\\""); s = JSCollections.$castArray(s.split("~")).join("\\~"); s = JSCollections.$castArray(s.split("*")).join("\\*"); s = JSCollections.$castArray(s.split("?")).join("\\?"); s = JSCollections.$castArray(s.split(":")).join("\\:"); s = JSCollections.$castArray(s.split("/")).join("\\/"); s = JSCollections.$castArray(s.split("+")).join("\\+"); return s;
@Override public Array<?> deserialize(JsonElement elem, Type type, JsonDeserializationContext ctx) throws JsonParseException { if (elem == null) { return null; } JsonArray js = elem.getAsJsonArray(); Type elementType = (type instanceof ParameterizedType) ? ((ParameterizedType) type).getActualTypeArguments()[0] : Object.class; Array<Object> array = JSCollections.$array(); for (int i = 0; i < js.size(); ++i) { array.push(ctx.deserialize(js.get(i), elementType)); } return array; }
/** * Checks if this encrypted value is an encrypted version of a specific * type, only works if the type wasn't hidden during encryption * * @param {String} type Type to compare if an encrypted type * @return {boolean} True if encrypted version of type, false if not or * can't tell * @memberOf EcEncryptedValue * @method isAnEncrypted */ public boolean isAnEncrypted(String type) { if (this.encryptedType == null) { return false; } Array<String> typeSplit = JSCollections.$castArray(type.split("/")); return this.encryptedType == type || this.encryptedType == typeSplit.$get(typeSplit.$length() - 1); }
@Template("properties") public static <T> Array<T> $castArray(T[] a) { return $array(a); }
public NodeRelationMap() { nodeList = new Array<Node>(); relationMap = JSCollections.$map(); }
@Override public void $invoke(Array<EcRemoteLinkedData> p1) { if (success != null) { Array<EcAssertion> ret = JSCollections.$array(); for (int i = 0; i < p1.$length(); i++) { EcAssertion assertion = new EcAssertion(); assertion.copyFrom(p1.$get(i)); ret.$set(i, assertion); } success.$invoke(ret); } }
public NodePacket() { nodeList = new Array<Node>(); nodeMap = JSCollections.$map(); }
@Override public void $invoke(Array<EcRemoteLinkedData> p1) { if (successAll != null) { Array<EcAlignment> rels = JSCollections.$array(); for (int i = 0; i < p1.$length(); i++) { EcAlignment a = new EcAlignment(); a.copyFrom(p1.$get(i)); rels.$set(i, a); } if (successAll != null) successAll.$invoke(rels); } }
@Override public Map<?, ?> deserialize(JsonElement elem, Type type, JsonDeserializationContext ctx) throws JsonParseException { if (elem == null) { return null; } JsonObject js = elem.getAsJsonObject(); Type valueType = (type instanceof ParameterizedType) ? ((ParameterizedType) type).getActualTypeArguments()[1] : Object.class; Map<String, Object> map = JSCollections.$map(); for (java.util.Map.Entry<String, JsonElement> entry : js.entrySet()) { map.$put(entry.getKey(), ctx.deserialize(entry.getValue(), valueType)); } return map; }
query = "(" + new EcAlignment().getSearchStringByType() + " AND (source:"; Array<String> noVersions = JSCollections.$array(); for (int i = 0; i < sourceIds.$length(); i++) { String sourceId = sourceIds.$get(i);
private void initBuilder(boolean createImpliedEdges) { this.createImpliedEdges = createImpliedEdges; competencyGraph = new CompetencyGraph(includeAssertions); assertionMap = JSCollections.$map(); frameworkRelationMap = JSCollections.$map(); frameworkRelationList = new Array<EcAlignment>(); assertionList = new Array<EcAssertion>(); }
@Override public void $invoke(Array<EcRemoteLinkedData> p1) { if (success != null) { Array<EcAlignment> ret = JSCollections.$array(); for (int i = 0; i < p1.$length(); i++) { EcAlignment alignment = new EcAlignment(); if (p1.$get(i).isAny(alignment.getTypes())) { alignment.copyFrom(p1.$get(i)); } else if (p1.$get(i).isA(EcEncryptedValue.myType)) { EcEncryptedValue val = new EcEncryptedValue(); val.copyFrom(p1.$get(i)); if (val.isAnEncrypted(EcAlignment.myType)) { EcRemoteLinkedData obj = val.decryptIntoObject(); alignment.copyFrom(obj); } } ret.$set(i, alignment); } success.$invoke(ret); } }
public CompetencyGraph(boolean includeAssertions) { nodes = new Array<String>(); edges = new Array<CgEdge>(); positiveAssertions = new Array<SimpleAssertion>(); negativeAssertions = new Array<SimpleAssertion>(); nodeMap = JSCollections.$map(); edgeMap = JSCollections.$map(); this.includeAssertions = includeAssertions; }
@Override public void $invoke(Array<EcRemoteLinkedData> p1) { if (success != null) { Array<EcConceptScheme> ret = JSCollections.$array(); for (int i = 0; i < p1.$length(); i++) { EcConceptScheme scheme = new EcConceptScheme(); if (p1.$get(i).isAny(scheme.getTypes())) { scheme.copyFrom(p1.$get(i)); } else if (p1.$get(i).isA(EcEncryptedValue.myType)) { EcEncryptedValue val = new EcEncryptedValue(); val.copyFrom(p1.$get(i)); if (val.isAnEncrypted(EcConceptScheme.myType)) { EcRemoteLinkedData obj = val.decryptIntoObject(); scheme.copyFrom(obj); EcEncryptedValue.encryptOnSave(scheme.id, true); } } ret.$set(i, scheme); } success.$invoke(ret); } }
public NodePacketGraph() { nodePacketList = new Array<NodePacket>(); nodePacketMap = JSCollections.$map(); relationList = new Array<PacketRelation>(); }
@Override public void $invoke(Array<EcRemoteLinkedData> p1) { if (success != null) { Array<EcFile> ret = JSCollections.$array(); for (int i = 0; i < p1.$length(); i++) { EcFile file = new EcFile(); if (p1.$get(i).isAny(file.getTypes())) { file.copyFrom(p1.$get(i)); } else if (p1.$get(i).isA(EcEncryptedValue.myType)) { EcEncryptedValue val = new EcEncryptedValue(); val.copyFrom(p1.$get(i)); if (val.isAnEncrypted(EcFile.myType)) { EcRemoteLinkedData obj = val.decryptIntoObject(); file.copyFrom(obj); EcEncryptedValue.encryptOnSave(file.id, true); } } ret.$set(i, file); } success.$invoke(ret); } } }, failure);
private void initDependenciesMap() { dependencies = JSCollections.$map(); String type; for (int i=0; i< PapDependency.getDependencyTypes().$length();i++) { type = PapDependency.getDependencyTypes().$get(i); Map<String,Array<PapDependency>> dependencySubMap = JSCollections.$map(); dependencies.$put(type,dependencySubMap); } }