@Override public void addElement(Element elmt) { super.addElement(elmt); this.model.getSimpleTypeOrComplexTypeOrGroup().add(((ElementImpl) elmt).getModel()); }
public ChoiceImpl(ExplicitGroup model, AbstractSchemaElementImpl parent) { super(model, parent); // get elements for (Object item : this.model.getParticle()) { if (item instanceof JAXBElement) { if (((JAXBElement) item).getValue() instanceof org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) { this.elements .add(new ElementImpl( (org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) ((JAXBElement) item) .getValue(), this)); } } // TODO: finish to analyze } }
public void setRef(QName name) { this.model.setRef(name); findReferencedElementIfExist(); }
List<WSDLElement> listOfWSDLElements = new ArrayList<>(); ElementImpl elmImpl = (ElementImpl) elm; if (elmImpl.getType() != null) { if (elmImpl.getType().getClass().toString().equals("class org.ow2.easywsdl.schema.impl" + ".ComplexTypeImpl")) { ComplexType complexType = (ComplexType) elmImpl.getType(); if(elmImpl.getType().getQName() != null){ WSDLElement tempElm = new WSDLElement(Constants.COMPLEX_TYPE, getTypeWithNamespace (targetNamespace, elmImpl.getType().getQName())); tempElm.setSubElements(getElementsOfComplexType(complexType, targetNamespace)); listOfWSDLElements.add(tempElm); } else if (elmImpl.getType().getClass().toString().equals("class org.ow2.easywsdl.schema.impl" + ".SimpleTypeImpl")) { SimpleType simpleType = (SimpleType) elmImpl.getType(); if (simpleType != null) { if (simpleType.getQName() != null) { if (isPrimitive(simpleType.getQName().getLocalPart())) { WSDLElement wsdlElement = new WSDLElement(elmImpl.getQName().getLocalPart(), getTypeWithNamespace(targetNamespace, simpleType.getQName())); listOfWSDLElements.add(wsdlElement); if (elmImpl.getModel().getType() != null) { wsdlElements.add(new WSDLElement(Constants.COMPLEX_TYPE, getTypeWithNamespace(targetNamespace, elmImpl .getModel() .getType()))); listOfWSDLElements = wsdlElements;
List<WSDLElement> subElms = null; String type = Constants.UNDEFINED_TYPE; String paramName = element.getModel().getName(); if (element.getRef() != null) { paramName = Constants.REFERENCE_TYPE; type = getTypeWithNamespace(targetNamespace, element.getRef()); } else { if (paramName == null) { paramName = Constants.UNDEFINED_TYPE; QName typeQName = element.getModel().getType(); if (typeQName != null) { type = getTypeWithNamespace(targetNamespace, element.getModel().getType()); QName typeQName = element.getModel().getType(); if (typeQName != null) { type = getTypeWithNamespace(targetNamespace, element.getModel().getType()); } else { type = paramName;
final ElementImpl e = new org.ow2.easywsdl.schema.impl.ElementImpl((org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) item, this); this.getElements().add(e); ((ElementImpl)elmt).findReferencedElementIfExist();
/** * * @param model * @param parent */ public ElementImpl( final org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element model, final AbstractSchemaElementImpl parent) { super(model, parent); findType(); //findReferencedElementIfExist(); }
/** * This method create a map of list of sub elements against element name * * @param schemaElements List of elements * @param targetNamespace TargetNamespace of the element * @return Map of list of sub elements against element name */ public HashMap<String, List<WSDLElement>> getElementTypes(List<Element> schemaElements, String targetNamespace) { HashMap<String, List<WSDLElement>> elementTypeToElements = new HashMap<>(); for (Element elm : schemaElements) { ElementImpl elmImpl = (ElementImpl) elm; elementTypeToElements.put(getTypeWithNamespace(targetNamespace, elmImpl.getQName()), getElementsOfElement (elm, targetNamespace)); } return elementTypeToElements; }
public FormChoice getForm() { FormChoice res = this.model.getForm(); if(res == null) { res = this.getParent().getSchema().getElementFormDefault(); } return res; }
@Override public Type getType() { if(this.type == null) { this.findType(); } return super.getType(); }
public AllImpl(org.ow2.easywsdl.schema.org.w3._2001.xmlschema.All model, AbstractSchemaElementImpl parent) { super(model, parent); // get elements for (Object item : this.model.getParticle()) { if (item instanceof JAXBElement) { if (((JAXBElement) item).getValue() instanceof org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) { this.elements .add(new ElementImpl( (org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) ((JAXBElement) item) .getValue(), this)); } } // TODO: finish to analyze } }
public void findReferencedElementIfExist() { if(this.getSequence() != null) { for(Element elmt: this.getSequence().getElements()) { ((ElementImpl)elmt).findReferencedElementIfExist(); } } if(this.getAll() != null) { for(Element elmt: this.getAll().getElements()) { ((ElementImpl)elmt).findReferencedElementIfExist(); } } if(this.getChoice() != null) { for(Element elmt: this.getChoice().getElements()) { ((ElementImpl)elmt).findReferencedElementIfExist(); } } }
public SequenceImpl(ExplicitGroup model, AbstractSchemaElementImpl parent) { super(model, parent); // get elements for (Object item : this.model.getParticle()) { if (item instanceof JAXBElement) { if (((JAXBElement) item).getValue() instanceof org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) { this.elements .add(new ElementImpl( (org.ow2.easywsdl.schema.org.w3._2001.xmlschema.Element) ((JAXBElement) item) .getValue(), this)); } } // TODO: finish to analyze } }
public QName getQName() { if (qname != null) return qname; if (this.model.getRef() != null) { // The element is defined by reference qname = this.model.getRef(); if (this.referencedElement == null) { findReferencedElementIfExist(); } } else if (this.model.getName() != null) { // The element is defined inlined final String prefix = this.parent.getSchema().getAllNamespaces().getPrefix( this.parent.getSchema().getTargetNamespace()); if (prefix != null) { qname = new QName(this.parent.getSchema().getTargetNamespace(), this.model.getName(), prefix); } else { qname = new QName(this.parent.getSchema().getTargetNamespace(), this.model.getName()); } } // Else the XSD is not valid, so we return null. return qname; }
public Element createElement() { return new ElementImpl(new LocalElement(), this); }
public Element createElement() { return new ElementImpl(new LocalElement(), this); }
public Element createElement() { return new ElementImpl(new TopLevelElement(), this); }
public Element createElement() { return new ElementImpl(new LocalElement(), this); }
public Element createElement() { return new ElementImpl(new LocalElement(), this); }