Search in sources :

Example 1 with XSDComponentChildElementsHolder

use of com.amalto.workbench.models.infoextractor.XSDComponentChildElementsHolder in project tmdm-studio-se by Talend.

the class LookupFieldsSection method initUIContents.

@Override
protected void initUIContents(XSDComponent editedObj) {
    super.initUIContents(editedObj);
    lookupFields.clear();
    XSDAnnotationsStructure annoStruct = new XSDAnnotationsStructure(curXSDComponent);
    for (String eachLookUpFields : annoStruct.getLookupFields().values()) lookupFields.add(eachLookUpFields);
    compElements.setElementsHolder(new XSDComponentChildElementsHolder(curXSDComponent));
}
Also used : XSDComponentChildElementsHolder(com.amalto.workbench.models.infoextractor.XSDComponentChildElementsHolder) XSDAnnotationsStructure(com.amalto.workbench.utils.XSDAnnotationsStructure)

Example 2 with XSDComponentChildElementsHolder

use of com.amalto.workbench.models.infoextractor.XSDComponentChildElementsHolder in project tmdm-studio-se by Talend.

the class XpathComposite method getItems.

protected String[] getItems() {
    Set<String> entities = section.getEntities();
    if (null != entities) {
        XSDSchema schema = getDatamodelXSD();
        Object[] child = getXSDSchemaChildren(schema);
        List<String> items = new LinkedList<String>();
        for (Object obj : child) {
            if (obj instanceof XSDNamedComponent) {
                if (entities.contains(((XSDNamedComponent) obj).getName())) {
                    XSDComponentChildElementsHolder holder = new XSDComponentChildElementsHolder((XSDNamedComponent) obj);
                    String[] eles = holder.getAllElements();
                    if (null == eles) {
                        continue;
                    }
                    for (String ele : eles) {
                        items.add(ele);
                    }
                }
            }
        }
        return items.toArray(new String[0]);
    }
    return null;
}
Also used : XSDNamedComponent(org.eclipse.xsd.XSDNamedComponent) XSDComponentChildElementsHolder(com.amalto.workbench.models.infoextractor.XSDComponentChildElementsHolder) LinkedList(java.util.LinkedList) XSDSchema(org.eclipse.xsd.XSDSchema)

Aggregations

XSDComponentChildElementsHolder (com.amalto.workbench.models.infoextractor.XSDComponentChildElementsHolder)2 XSDAnnotationsStructure (com.amalto.workbench.utils.XSDAnnotationsStructure)1 LinkedList (java.util.LinkedList)1 XSDNamedComponent (org.eclipse.xsd.XSDNamedComponent)1 XSDSchema (org.eclipse.xsd.XSDSchema)1