public AttributeExtension getAttributeExtension(String ns, String lp){ for(AttributeExtension att : attributeExtensions){ if(att.getAttributeQNameNS().equals(ns) && att.getAttributeQNameLocalPart().equals(lp)){ return att; } } return null; }
public AttributeExtension getAttributeExtension(String ns, String lp){ for(AttributeExtension att : attributeExtensions){ if(att.getAttributeQNameNS().equals(ns) && att.getAttributeQNameLocalPart().equals(lp)){ return att; } } return null; }
public void addAttributeExtension(AttributeExtension att){ for(AttributeExtension a : attributeExtensions){ if(a.hasSameErasure(att)){ throw new IllegalArgumentException( "This element ("+id+") already has an attribute with QName " +a.getAttributeQNameNS()+":"+a.getAttributeQNameLocalPart()+"."); } } this.attributeExtensions.add(att); }
public void addAttributeExtension(AttributeExtension att){ for(AttributeExtension a : attributeExtensions){ if(a.hasSameErasure(att)){ String qname = a.getAttributeQNameNS()+":"+a.getAttributeQNameLocalPart(); throw new IllegalArgumentException( "This element ("+id+") already has an attribute with QName "+qname+"."); } } this.attributeExtensions.add(att); }
private void adaptAttributeExtensions(WithOtherAttributes element, WithAttributeExtension bean){ for(AttributeExtension att : bean.getAttributeExtensions()){ element.addOtherAttribute(new QName(att.getAttributeQNameNS(), att.getAttributeQNameLocalPart()), att.getAttributeValue()); } }
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()); } } }