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

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


      public boolean retainAll(Collection<?> c) {
        throw new UnsupportedModelOperationException("retainAll()", "not implemented");
      }

      public void clear() {
        DomElement domElement = getDomElement();
        List<DomElement> childElements = domElement.getChildElements();
        for (DomElement childElement : childElements) {
          domElement.removeChild(childElement);
        }
      }
    };
  }
View Full Code Here


      return (T) ModelUtil.getModelElement(childElements.get(0), modelInstance);
    }
  }

  public void removeValue() {
    DomElement domElement = getDomElement();
    List<DomElement> childElements = domElement.getChildElements();
    for (DomElement childElement : childElements) {
      domElement.removeChild(childElement);
    }
  }
View Full Code Here

    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

  }

  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

  public DomDocument getDocument() {
    return document;
  }

  public ModelElementInstance getDocumentElement() {
    DomElement rootElement = document.getRootElement();
    if(rootElement != null) {
      return ModelUtil.getModelElement(rootElement, this);
    } else {
      return null;
    }
View Full Code Here

    }
  }

  public void setDocumentElement(ModelElementInstance modelElement) {
    ModelUtil.ensureInstanceOf(modelElement, ModelElementInstanceImpl.class);
    DomElement domElement = modelElement.getDomElement();
    document.setRootElement(domElement);
  }
View Full Code Here

  public <T extends ModelElementInstance> T getModelElementById(String id) {
    if (id == null) {
      return null;
    }

    DomElement element = document.getElementById(id);
    if(element != null) {
      return (T) ModelUtil.getModelElement(element, this);
    } else {
      return null;
    }
View Full Code Here

  public DOMSource getDomSource() {
    return new DOMSource(document);
  }

  public String registerNamespace(String namespaceUri) {
    DomElement rootElement = getRootElement();
    if (rootElement != null) {
      return rootElement.registerNamespace(namespaceUri);
    }
    else {
      throw new ModelException("Unable to define a new namespace without a root document element");
    }
  }
View Full Code Here

      throw new ModelException("Unable to define a new namespace without a root document element");
    }
  }

  public void registerNamespace(String prefix, String namespaceUri) {
    DomElement rootElement = getRootElement();
    if (rootElement != null) {
      rootElement.registerNamespace(prefix, namespaceUri);
    }
    else {
      throw new ModelException("Unable to define a new namespace without a root document element");
    }
  }
View Full Code Here

  public ModelInstanceImpl getModelInstance() {
    return modelInstance;
  }

  public ModelElementInstance getParentElement() {
    DomElement parentElement = domElement.getParentElement();
    if (parentElement != null) {
      return ModelUtil.getModelElement(parentElement, modelInstance);
    }
    else {
      return null;
View Full Code Here

TOP

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

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.