Examples of ElementInfo


Examples of org.apache.tuscany.sca.interfacedef.util.ElementInfo

    /**
     * @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
     */
    public DataType getWrapperType(Operation operation, boolean input) {
        WrapperInfo wrapper = operation.getWrapper();
        ElementInfo element = input ? wrapper.getInputWrapperElement() : wrapper.getOutputWrapperElement();
        DataType<XMLType> wrapperType =
            new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, new XMLType(element));
        return wrapperType;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.ElementInfo

        return wrapperType;
    }

    public boolean isInstance(Object wrapperObj, Operation operation, boolean input) {
        WrapperInfo wrapperInfo = operation.getWrapper();
        ElementInfo element = input ? wrapperInfo.getInputWrapperElement() : wrapperInfo.getOutputWrapperElement();
        //        List<ElementInfo> childElements =
        //            input ? wrapperInfo.getInputChildElements() : wrapperInfo.getOutputChildElements();
        OMElement wrapper = (OMElement)wrapperObj;
        if (!element.getQName().equals(wrapper.getQName())) {
            return false;
        }
        return true;
        /*
        Set<QName> names = new HashSet<QName>();
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.ElementInfo

                    QName element = new QName(ns, name);
                    Object logical = operation.getInputType().getLogical().get(i).getLogical();
                    if (logical instanceof XMLType) {
                        ((XMLType)logical).setElementName(element);
                    }
                    inputElements.add(new ElementInfo(element, null));
                }

                List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
                WebResult result = method.getAnnotation(WebResult.class);
                // Default to "" for doc-lit-wrapped && non-header
                ns = result != null ? result.targetNamespace() : "";
                ns = getValue(ns, documentStyle && (result == null || !result.header()) ? "" : tns);
                name = result != null ? result.name() : "";
                name = getValue(name, "return");
                QName element = new QName(ns, name);

                if (operation.getOutputType() != null) {
                    Object logical = operation.getOutputType().getLogical();
                    if (logical instanceof XMLType) {
                        ((XMLType)logical).setElementName(element);
                    }
                    outputElements.add(new ElementInfo(element, null));
                }

                String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING;
                WrapperInfo wrapperInfo =
                    new WrapperInfo(db, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper, null),
                                    inputElements, outputElements);

                wrapperInfo.setInputWrapperType(inputWrapperDT);
                wrapperInfo.setOutputWrapperType(outputWrapperDT);
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.ElementInfo

    private static ElementInfo getElementInfo(XmlSchemaElement element) {
        if (element == null) {
            return null;
        }
        ElementInfo elementInfo = new ElementInfo(element.getQName(), getTypeInfo(element.getSchemaType()));
        elementInfo.setMany(element.getMaxOccurs() > 1);
        elementInfo.setNillable(element.isNillable());
        return elementInfo;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.ElementInfo

        }
        */

        public WrapperInfo getWrapperInfo() throws InvalidWSDLException {
            if (wrapperInfo == null) {
                ElementInfo in = getElementInfo(getInputWrapperElement());
                ElementInfo out = getElementInfo(getOutputWrapperElement());
                List<ElementInfo> inChildren = new ArrayList<ElementInfo>();
                if (in != null) {
                    for (XmlSchemaElement e : getInputChildElements()) {
                        inChildren.add(getElementInfo(e));
                    }
View Full Code Here

Examples of org.apache.tuscany.spi.idl.ElementInfo

    public Java2SimpleTypeTransformer(SimpleTypeMapper mapper) {
        this.mapper = (mapper != null) ? mapper : new SimpleTypeMapperExtension();
    }

    public T transform(Object source, TransformationContext context) {
        ElementInfo element =
                (ElementInfo) context.getTargetDataType().getMetadata(ElementInfo.class.getName());
        TypeInfo simpleType = (TypeInfo) element.getType();
        String text = mapper.toXMLLiteral(simpleType, source, context);
        return createElement(element, text, context);
    }
View Full Code Here

Examples of org.apache.xmlbeans.impl.jaxb.compiler.ElementInfo

    public TypeStoreUser createElementUser(SchemaType parentType, QName name, QName xsiType)
    {
        if (parentType.isDocumentType())
        {
            ElementInfo ei = (ElementInfo)_globalElements.get(name);
            if (ei == null) return null;
            try {
                Constructor ctr = ei.getJavaImplConstructor(parentType.getTypeSystem().getClassLoader());
                return (TypeStoreUser)ctr.newInstance(null);
            }
            catch (Exception e)
            {
                return null;
View Full Code Here

Examples of org.platformlayer.xml.XmlHelper.ElementInfo

import com.google.common.base.Objects;

public abstract class TypedItemMapper {

  public <T> T promoteToTyped(UntypedItem untypedItem) throws OpsException {
    ElementInfo elementInfo = ((UntypedItemXml) untypedItem).getRootElementInfo();

    Class<T> javaClass = mapToJavaClass(elementInfo);

    return promoteToTyped(untypedItem, javaClass);
  }
View Full Code Here

Examples of org.platformlayer.xml.XmlHelper.ElementInfo

  }

  public void visit(UntypedItem item) throws PlatformLayerClientException {
    UntypedItemXml untypedItem = (UntypedItemXml) item;

    ElementInfo rootElementInfo = untypedItem.getRootElementInfo();

    boolean consider = true;

    switch (untypedItem.getState()) {
    case DELETED:
View Full Code Here

Examples of org.platformlayer.xml.XmlHelper.ElementInfo

  @Override
  public <T extends ItemBase> ModelClass<T> getModelClass(Class<T> itemClass) {
    ModelClass<T> modelClass = javaClassToModelClass.get(itemClass);
    if (modelClass == null) {
      // Fallback to matching on XML info
      ElementInfo elementInfo = XmlHelper.getXmlElementInfo(itemClass);

      if (elementInfo != null) {
        ServiceProvider serviceProvider = serviceProvidersByNamespace.get(elementInfo.namespace);
        if (serviceProvider != null) {
          ItemType itemType = new ItemType(elementInfo.elementName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.