<commit_before>package com.nedap.archie.rm.archetypes;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nedap.archie.query.APathQuery;
import com.nedap.archie.rm.RMObject;
import com.nedap.archie.rminfo.ArchieRMInfoLookup;

import javax.xml.bind.annotation.XmlTransient;

/**
 * Created by pieter.bos on 04/11/15.
 */
public class Pathable extends RMObject {
    //TODO: implement according to spec: pathExists(path), pathUnique(path), pathOfItem(pathable)

    @JsonIgnore
    @XmlTransient
    private Pathable parent;

    public Object itemAtPath(String s) {
        return new APathQuery(s).find(ArchieRMInfoLookup.getInstance(), this);
    }

    @JsonIgnore
    @XmlTransient
    public Pathable getParent() {
        return parent;
    }

    public void setParent(Pathable parent) {
        this.parent = parent;
    }

    /**
    * Utility method to set this object as the parent of the given child,
    * if the child is not null
    */
    protected void setThisAsParent(Pathable child) {
        if(child != null) {
            child.setParent(this);
        }
    }

}
<commit_msg>add the itemsAtPath-method, which uses the new findList method of APathQuery<commit_after>package com.nedap.archie.rm.archetypes;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nedap.archie.query.APathQuery;
import com.nedap.archie.rm.RMObject;
import com.nedap.archie.rminfo.ArchieRMInfoLookup;

import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
 * Created by pieter.bos on 04/11/15.
 */
public class Pathable extends RMObject {
    //TODO: implement according to spec: pathExists(path), pathUnique(path), pathOfItem(pathable)

    @JsonIgnore
    @XmlTransient
    private Pathable parent;

    public Object itemAtPath(String s) {
        return new APathQuery(s).find(ArchieRMInfoLookup.getInstance(), this);
    }
    
    public List<Object> itemsAtPath(String s) {
        return new APathQuery(s).findList(ArchieRMInfoLookup.getInstance(), this);
    }

    @JsonIgnore
    @XmlTransient
    public Pathable getParent() {
        return parent;
    }

    public void setParent(Pathable parent) {
        this.parent = parent;
    }

    /**
    * Utility method to set this object as the parent of the given child,
    * if the child is not null
    */
    protected void setThisAsParent(Pathable child) {
        if(child != null) {
            child.setParent(this);
        }
    }

}

{'fraction_non_alphanumeric': 0.09836734693877551, 'fraction_numerical': 0.004897959183673469, 'mean_word_length': 3.0782029950083194, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4557278', 'n_tokens_mistral': 782, 'n_tokens_neox': 747, 'n_words': 184}