gpt4 book ai didi

com.ebmwebsourcing.easybox.api.XmlObjectFactory.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 06:01:05 27 4
gpt4 key购买 nike

本文整理了Java中com.ebmwebsourcing.easybox.api.XmlObjectFactory.create()方法的一些代码示例,展示了XmlObjectFactory.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlObjectFactory.create()方法的具体详情如下:
包路径:com.ebmwebsourcing.easybox.api.XmlObjectFactory
类名称:XmlObjectFactory
方法名:create

XmlObjectFactory.create介绍

暂无

代码示例

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private <T extends XmlObjectNode> T newInstance(Class<? extends T> c){
  if(context==null){
    context = new XmlContextFactory().newContext();
  }
  return context.getXmlObjectFactory().create(c);
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static Point getPoint(IPoint point) {
  Point result = objectFactory.create(Point.class);
  
  result.setX(point.getX());
  result.setY(point.getY());
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static BPMNLabelStyle getLabelStyle(IBPMNLabelStyle style) {
  BPMNLabelStyle result = objectFactory.create(BPMNLabelStyle.class);
  
  result.setId(style.getId());
  result.setFont(getFont(style.getFont()));
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static BPMNLabel getLabel(IBPMNLabel label) {
  BPMNLabel result = objectFactory.create(BPMNLabel.class);
  
  result.setId(label.getId());
  result.setLabelStyle(new QName(label.getBPMNLabelStyle().getId()));
  
  adaptExtensions(label, result);
  
  result.setBounds(getBounds((com.ebmwebsourcing.petalsbpm.business.domain.di.impl.BPMNLabel)label));
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static void adaptExtensions(IDiagramElement bean, DiagramElement elt){
    if(!bean.getObjectExtensions().isEmpty()){
      Extension ee = objectFactory.create(Extension.class);
      for(ObjectExtension obj : bean.getObjectExtensions()){
        ee.addAnyXmlObject(bindingManager.clientToServer(obj));
      }
      elt.setExtension(ee);
    }
    
    for(AttributeExtension att : bean.getAttributeExtensions()){
      elt.addOtherAttribute(new QName(att.getAttributeQNameNS(), att.getAttributeQNameLocalPart()), att.getAttributeValue());
    }
  }
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static BPMNPlane getPlane(IBPMNPlane plane){
  BPMNPlane result = objectFactory.create(BPMNPlane.class);
  result.setId(plane.getId());
  result.setBpmnElement(new QName(plane.getModelElement().getId()));
  
  adaptExtensions(plane, result);
  
  for(IDiagramElement de : plane.getOwnedElements()){
    result.addDiagramElement(getDiagramElement(de));
  }
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.easybox/easybox-impl

@SuppressWarnings("unchecked")
public <X extends XmlObject> X readFragment(InputSource inputSource,
    Class<X> xmlObjectInterfaceClass) throws XmlObjectReadException {
  try {
    DocumentBuilder documentBuilder = createDocumentBuilder();
    AbstractJaxbXmlObjectImpl<AbstractJaxbModelObject> newXmlObject = (AbstractJaxbXmlObjectImpl<AbstractJaxbModelObject>) xmlContext
        .getXmlObjectFactory().create(xmlObjectInterfaceClass);
    // create a dummy model, but which should be valid from a type point
    // of view.
    Class<? extends AbstractJaxbModelObject> modelClass = newXmlObject
        .getModelObject().getClass();
    Binder<Node> binder = newBinder();
    Object unmarshalled = binder.unmarshal(documentBuilder.parse(inputSource), modelClass);
    AbstractJaxbModelObject jaxbModelObject = asAbstractJaxbObject(unmarshalled);
    jaxbModelObject.setBinder(binder);
    newXmlObject.setModelObject(jaxbModelObject);
    finalizeReading(newXmlObject, inputSource.getSystemId());
    return xmlObjectInterfaceClass.cast(newXmlObject);
  } catch (JAXBException je) {
    throw new XmlObjectReadException(je);
  } catch (SAXException se) {
    throw new XmlObjectReadException(se);
  } catch (IOException ioe) {
    throw new XmlObjectReadException(ioe);
  }
}

代码示例来源:origin: com.ebmwebsourcing.easybox/easybox-impl

@SuppressWarnings("unchecked")
  public <X extends XmlObject> X readFragment(Document document,
      Class<X> xmlObjectInterfaceClass) throws XmlObjectReadException {
    try {
      AbstractJaxbXmlObjectImpl<AbstractJaxbModelObject> newXmlObject = (AbstractJaxbXmlObjectImpl<AbstractJaxbModelObject>) xmlContext
          .getXmlObjectFactory().create(xmlObjectInterfaceClass);
      // create a dummy model, but which should be valid from a type point
      // of view.
      Class<? extends AbstractJaxbModelObject> modelClass = newXmlObject
          .getModelObject().getClass();

      Binder<Node> binder = newBinder();
      Object unmarshalled = binder.unmarshal(document, modelClass);
      AbstractJaxbModelObject jaxbModelObject = asAbstractJaxbObject(unmarshalled);
      jaxbModelObject.setBinder(binder);
      newXmlObject.setModelObject(jaxbModelObject);

      finalizeReading(newXmlObject, document.getBaseURI());

      return xmlObjectInterfaceClass.cast(newXmlObject);
    } catch (JAXBException je) {
      throw new XmlObjectReadException(je);
    }
  }  
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static Bounds getBounds(IBounds bounds) {
  Bounds result = objectFactory.create(Bounds.class);
  
  result.setHeight(bounds.getHeight());
  result.setWidth(bounds.getWidth());
  result.setX(bounds.getX());
  result.setY(bounds.getY());
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

public static BPMNDiagram generateBPMNDiagram(IBPMNDiagram diagram){
  objectFactory = new XmlContextFactory().newContext().getXmlObjectFactory();
  bindingManager = new ExtensionBindingManager();
  pools = new HashMap<IParticipantBean, IBounds>();
  lanes = new HashMap<ILaneBean, Bounds>();
  
  BPMNDiagram result = objectFactory.create(BPMNDiagram.class);
  result.setName(diagram.getName());
  result.setResolution(diagram.getResolution());
  result.setDocumentation(diagram.getDocument());
  
  result.setBPMNPlane(getPlane(diagram.getRootElement()));
  
  if(diagram.getStyles()!=null){
    for(IStyle style : diagram.getStyles()){
      result.addBPMNLabelStyle(getLabelStyle((IBPMNLabelStyle)style));
    }
  }
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static Font getFont(
    com.ebmwebsourcing.geasytools.diagrameditor.domain.diagramdefinition.diagramcommon.layout.Font font) {
  Font result = objectFactory.create(Font.class);
  
  result.setIsBold(font.isBold());
  result.setIsItalic(font.isItalic());
  result.setIsStrikeThrough(font.isStrikeThrough());
  result.setIsUnderline(font.isUnderline());
  result.setName(font.getName());
  result.setSize(font.getSize());
  
  return result;
}

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static BPMNEdge getEdge(IBPMNEdge edge) {
  BPMNEdge result = objectFactory.create(BPMNEdge.class);

代码示例来源:origin: com.ebmwebsourcing.easybpel/model-bpel-api

.getXmlObjectFactory();
final com.ebmwebsourcing.easyschema10.api.element.Schema schema = factory
    .create(com.ebmwebsourcing.easyschema10.api.element.Schema.class);
schema.setTargetNamespace(desc.getProcessNamespace());
schema.setElementFormDefault(Form.QUALIFIED);
    .create(com.ebmwebsourcing.easyschema10.api.element.Element.class);

代码示例来源:origin: com.ebmwebsourcing.petalsbpm/petalsbpm-service

private static BPMNShape getShape(IBPMNShape shape) {
  BPMNShape result = objectFactory.create(BPMNShape.class);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com