Search in sources :

Example 71 with Attribute

use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.

the class XMLWriter method addDeparture.

public void addDeparture(Element departures_element, Departure departure) {
    Element dep = new Element("departure");
    dep.setAttribute(new Attribute("id", departure.getId()));
    dep.setAttribute(new Attribute("vehicleRefId", departure.getVehicleRefId()));
    dep.setAttribute(new Attribute("departureTime", departure.getDepartureTime()));
    departures_element.addContent(dep);
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 72 with Attribute

use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.

the class XMLWriter method addStopFacility.

public void addStopFacility(Element tstops, Stop stop) {
    Element stopFacility = new Element("stopFacility");
    stopFacility.setAttribute(new Attribute("isBlocking", Boolean.toString(stop.getIsBlocking())));
    stopFacility.setAttribute(new Attribute("name", stop.getName()));
    Coord coord = stop.getCoord();
    coord = ct.transform(coord);
    stopFacility.setAttribute(new Attribute("x", Double.toString(coord.getX())));
    stopFacility.setAttribute(new Attribute("y", Double.toString(coord.getY())));
    stopFacility.setAttribute(new Attribute("id", stop.getId()));
    tstops.addContent(stopFacility);
}
Also used : Coord(org.matsim.api.core.v01.Coord) Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 73 with Attribute

use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.

the class XMLWriter method addLink.

public void addLink(Element route, Link link) {
    Element link_element = new Element("link");
    // Temporarily for teleportation
    link_element.setAttribute(new Attribute("refId", ""));
    route.addContent(link_element);
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 74 with Attribute

use of com.github.zhenwei.core.asn1.x509.Attribute in project vsp-playgrounds by matsim-vsp.

the class XMLWriter method addStop.

public void addStop(Element transitRoute, Stop st) {
    Element stop = new Element("stop");
    stop.setAttribute(new Attribute("awaitDeparture", Boolean.toString(st.getAwaitDeparture())));
    stop.setAttribute(new Attribute("departureOffset", st.getDepartureOffset()));
    stop.setAttribute(new Attribute("arrivalOffset", st.getArrivalOffset()));
    stop.setAttribute(new Attribute("refId", st.getId()));
    transitRoute.addContent(stop);
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Example 75 with Attribute

use of com.github.zhenwei.core.asn1.x509.Attribute in project mars-sim by mars-sim.

the class CrewConfig method createItemDoc.

/**
 * Creates an XML document for this crew.
 *
 * @return
 */
@Override
protected Document createItemDoc(Crew roster) {
    Element root = new Element(CREW_COFIG);
    Document doc = new Document(root);
    root.setAttribute(new Attribute(NAME_ATTR, roster.getName()));
    root.setAttribute(new Attribute(DESC_ATTR, roster.getDescription()));
    Element crewList = new Element(CREW_LIST);
    List<Element> personList = new ArrayList<>();
    for (Member person : roster.getTeam()) {
        Element personElement = new Element(PERSON);
        personElement.setAttribute(new Attribute(NAME_ATTR, person.getName()));
        personElement.setAttribute(new Attribute(GENDER, person.getGender().name()));
        personElement.setAttribute(new Attribute(AGE, person.getAge()));
        personElement.setAttribute(new Attribute(PERSONALITY_TYPE, person.getMBTI()));
        saveOptionalAttribute(personElement, SPONSOR, person.getSponsorCode());
        personElement.setAttribute(new Attribute(COUNTRY, person.getCountry()));
        personElement.setAttribute(new Attribute(JOB, person.getJob()));
        saveOptionalAttribute(personElement, ACTIVITY, person.getActivity());
        saveOptionalAttribute(personElement, MAIN_DISH, person.getMainDish());
        saveOptionalAttribute(personElement, SIDE_DISH, person.getSideDish());
        saveOptionalAttribute(personElement, DESSERT, person.getDessert());
        // 
        // Element traitList = new Element(PERSONALITY_TRAIT_LIST);
        // 
        // Element trait0 = new Element(PERSONALITY_TRAIT);
        // trait0.setAttribute(new Attribute(NAME, "openness"));
        // trait0.setAttribute(new Attribute(VALUE, "25"));
        // traitList.addContent(trait0);
        personList.add(personElement);
    }
    crewList.addContent(personList);
    doc.getRootElement().addContent(crewList);
    return doc;
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element) ArrayList(java.util.ArrayList) Document(org.jdom2.Document)

Aggregations

Attribute (org.jdom2.Attribute)316 Element (org.jdom2.Element)210 IOException (java.io.IOException)98 ArrayList (java.util.ArrayList)75 Attribute (ucar.nc2.Attribute)65 List (java.util.List)46 Document (org.jdom2.Document)43 Variable (ucar.nc2.Variable)39 HashMap (java.util.HashMap)26 Extensions (org.bouncycastle.asn1.x509.Extensions)26 X509Certificate (java.security.cert.X509Certificate)24 Namespace (org.jdom2.Namespace)24 File (java.io.File)23 Attribute (org.bouncycastle.asn1.pkcs.Attribute)21 GeneralName (org.bouncycastle.asn1.x509.GeneralName)21 Array (ucar.ma2.Array)21 Test (org.junit.Test)20 GeneralNames (org.bouncycastle.asn1.x509.GeneralNames)19 Dimension (ucar.nc2.Dimension)19 Map (java.util.Map)17