Package org.camunda.bpm.model.xml.instance

Examples of org.camunda.bpm.model.xml.instance.DomDocument


    return referenceSourceType;
  }

  @SuppressWarnings("unchecked")
  private Collection<DomElement> getView(ModelElementInstanceImpl referenceSourceParentElement) {
    DomDocument document = referenceSourceParentElement.getModelInstance().getDocument();
    Collection<Source> referenceSourceElements = referenceSourceCollection.get(referenceSourceParentElement);
    Collection<DomElement> referenceTargetElements = new ArrayList<DomElement>();
    for (Source referenceSourceElement : referenceSourceElements) {
      String identifier = getReferenceIdentifier(referenceSourceElement);
      DomElement referenceTargetElement = document.getElementById(identifier);
      if (referenceTargetElement != null) {
        referenceTargetElements.add(referenceTargetElement);
      }
      else {
        throw new ModelException("Unable to find a model element instance for id " + identifier);
View Full Code Here


    this.instanceType = instanceType;
  }

  public ModelElementInstance newInstance(ModelInstance modelInstance) {
    ModelInstanceImpl modelInstanceImpl = (ModelInstanceImpl) modelInstance;
    DomDocument document = modelInstanceImpl.getDocument();
    DomElement domElement = document.createElement(typeNamespace, typeName);
    return newInstance(modelInstanceImpl, domElement);
  }
View Full Code Here

    return allChildElementCollections;
  }

  public Collection<ModelElementInstance> getInstances(ModelInstance modelInstance) {
    ModelInstanceImpl modelInstanceImpl = (ModelInstanceImpl) modelInstance;
    DomDocument document = modelInstanceImpl.getDocument();
    List<DomElement> elements = document.getElementsByNameNs(typeNamespace, typeName);
    List<ModelElementInstance> resultList = new ArrayList<ModelElementInstance>();
    for (DomElement element : elements) {
      resultList.add(ModelUtil.getModelElement(element, modelInstanceImpl));
    }
    return resultList;
View Full Code Here

  }

  protected abstract String getTargetElementIdentifier(T referenceTargetElement);

  private Collection<DomElement> getView(ModelElementInstance referenceSourceElement) {
    DomDocument document = referenceSourceElement.getModelInstance().getDocument();

    String identifier = getReferenceIdentifier(referenceSourceElement);
    List<String> references = StringUtil.splitListBySeparator(identifier, separator);

    Collection<DomElement> referenceTargetElements = new ArrayList<DomElement>();
    for (String reference : references) {
      DomElement referenceTargetElement = document.getElementById(reference);
      if (referenceTargetElement != null) {
        referenceTargetElements.add(referenceTargetElement);
      }
      else {
        throw new ModelException("Unable to find a model element instance for id " + identifier);
View Full Code Here

      return null;
    }
  }

  public DomElement getRootElement() {
    DomDocument document = getDocument();
    if (document != null) {
      return document.getRootElement();
    }
    else {
      return null;
    }
  }
View Full Code Here

    dbf.setIgnoringElementContentWhitespace(false);
    dbf.setNamespaceAware(true);
  }

  public ModelInstance parseModelFromStream(InputStream inputStream) {
    DomDocument document = DomUtil.parseInputStream(documentBuilderFactory, inputStream);
    validateModel(document);
    return createModelInstance(document);

  }
View Full Code Here

    return createModelInstance(document);

  }

  public ModelInstance getEmptyModel() {
    DomDocument document = DomUtil.getEmptyDocument(documentBuilderFactory);
    return createModelInstance(document);
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.model.xml.instance.DomDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.