Search in sources :

Example 1 with CustomStaxReader

use of org.kie.dmn.backend.marshalling.CustomStaxReader in project drools by kiegroup.

the class DMNModelInstrumentedBaseConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    KieDMNModelInstrumentedBase mib = (KieDMNModelInstrumentedBase) parent;
    CustomStaxReader customStaxReader = (CustomStaxReader) reader.underlyingReader();
    Map<String, String> currentNSCtx = customStaxReader.getNsContext();
    mib.getNsContext().putAll(currentNSCtx);
    mib.setLocation(customStaxReader.getLocation());
    mib.setAdditionalAttributes(customStaxReader.getAdditionalAttributes());
}
Also used : CustomStaxReader(org.kie.dmn.backend.marshalling.CustomStaxReader) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase)

Example 2 with CustomStaxReader

use of org.kie.dmn.backend.marshalling.CustomStaxReader in project drools by kiegroup.

the class DMNModelInstrumentedBaseConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    KieDMNModelInstrumentedBase mib = (KieDMNModelInstrumentedBase) parent;
    CustomStaxReader customStaxReader = (CustomStaxReader) reader.underlyingReader();
    Map<String, String> currentNSCtx = customStaxReader.getNsContext();
    mib.getNsContext().putAll(currentNSCtx);
    mib.setLocation(customStaxReader.getLocation());
    mib.setAdditionalAttributes(customStaxReader.getAdditionalAttributes());
}
Also used : CustomStaxReader(org.kie.dmn.backend.marshalling.CustomStaxReader) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_3.KieDMNModelInstrumentedBase)

Example 3 with CustomStaxReader

use of org.kie.dmn.backend.marshalling.CustomStaxReader in project drools by kiegroup.

the class DMNModelInstrumentedBaseConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    KieDMNModelInstrumentedBase mib = (KieDMNModelInstrumentedBase) parent;
    CustomStaxReader customStaxReader = (CustomStaxReader) reader.underlyingReader();
    Map<String, String> currentNSCtx = customStaxReader.getNsContext();
    mib.getNsContext().putAll(currentNSCtx);
    mib.setLocation(customStaxReader.getLocation());
    mib.setAdditionalAttributes(customStaxReader.getAdditionalAttributes());
}
Also used : CustomStaxReader(org.kie.dmn.backend.marshalling.CustomStaxReader) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_4.KieDMNModelInstrumentedBase)

Example 4 with CustomStaxReader

use of org.kie.dmn.backend.marshalling.CustomStaxReader in project drools by kiegroup.

the class QNameConverter method unmarshal.

@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    QName qname = MarshallingUtils.parseQNameString(reader.getValue());
    Map<String, String> currentNSCtx = ((CustomStaxReader) reader.underlyingReader()).getNsContext();
    String qnameURI = currentNSCtx.get(qname.getPrefix());
    if (qnameURI != null) {
        return new QName(qnameURI, qname.getLocalPart(), qname.getPrefix());
    }
    return qname;
}
Also used : QName(javax.xml.namespace.QName) CustomStaxReader(org.kie.dmn.backend.marshalling.CustomStaxReader)

Example 5 with CustomStaxReader

use of org.kie.dmn.backend.marshalling.CustomStaxReader in project drools by kiegroup.

the class DMNModelInstrumentedBaseConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    KieDMNModelInstrumentedBase mib = (KieDMNModelInstrumentedBase) parent;
    CustomStaxReader customStaxReader = (CustomStaxReader) reader.underlyingReader();
    Map<String, String> currentNSCtx = customStaxReader.getNsContext();
    mib.getNsContext().putAll(currentNSCtx);
    mib.setLocation(customStaxReader.getLocation());
    mib.setAdditionalAttributes(customStaxReader.getAdditionalAttributes());
}
Also used : CustomStaxReader(org.kie.dmn.backend.marshalling.CustomStaxReader) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase)

Aggregations

CustomStaxReader (org.kie.dmn.backend.marshalling.CustomStaxReader)6 QNameMap (com.thoughtworks.xstream.io.xml.QNameMap)1 StaxDriver (com.thoughtworks.xstream.io.xml.StaxDriver)1 BufferedReader (java.io.BufferedReader)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 QName (javax.xml.namespace.QName)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1 DMNExtensionRegister (org.kie.dmn.api.marshalling.DMNExtensionRegister)1 DMNMarshaller (org.kie.dmn.api.marshalling.DMNMarshaller)1 Definitions (org.kie.dmn.model.api.Definitions)1 KieDMNModelInstrumentedBase (org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase)1 KieDMNModelInstrumentedBase (org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase)1 KieDMNModelInstrumentedBase (org.kie.dmn.model.v1_3.KieDMNModelInstrumentedBase)1 KieDMNModelInstrumentedBase (org.kie.dmn.model.v1_4.KieDMNModelInstrumentedBase)1 Logger (org.slf4j.Logger)1