Package be.selckin.ws.util.java2php.php

Examples of be.selckin.ws.util.java2php.php.TypeHint


        code.append(name);
        code.append("(");
        code.append(Joiner.on(", ").join(Iterables.transform(arguments, new Function<Argument, String>() {
            @Override
            public String apply(Argument input) {
                TypeHint typeHint = input.getTypeHint();
                String hint = "";
                if (typeHint.isArray()) {
                    hint = "array ";
                } else if (!typeHint.isPrimitive()) {
                    hint = typeHint.getName() + ' ';
                }

                return hint + '$' + input.getName();
            }
        })));
View Full Code Here


        }
        return "";
    }

    public void appendPhpDocParam(String name, PhpProperty phpProperty) throws IOException {
        TypeHint typeHint = phpProperty.getTypeHint();
        if (!typeHint.isPrimitive()) {
            String hint = typeHint.getName() + (typeHint.isArray() ? "[]" : "");
            appendLine("/* @param " + hint + " $" + name + " */");
        }
    }
View Full Code Here

        List<Argument> arguments = Lists.newArrayList();
        for (int i = 0; i < sequence.getItems().size(); i++) {
            XmlSchemaSequenceMember sequenceItem = sequence.getItems().get(i);
            ParticleInfo itemInfo = ParticleInfo.forLocalItem((XmlSchemaObject) sequenceItem, wrapperSchema, xmlSchemaCollection, prefixAccumulator, contextQName);

            TypeHint typeHint;
            XmlSchemaType type = itemInfo.getType(); // null for an any.
            if (type instanceof XmlSchemaComplexType) {
                QName baseName;
                if (type.getQName() != null) {
                    baseName = type.getQName();
                } else {
                    baseName = ((XmlSchemaElement) sequenceItem).getQName();
                }
                typeHint = new TypeHint(itemInfo.isArray(), nameManager.getAbsolutePhpClassName(baseName));
            } else {
                typeHint = new TypeHint(itemInfo.isArray());
            }

            arguments.add(new Argument(typeHint, itemInfo.getXmlName()));
        }

        TypeHint returnType = findReturnType(currentOperation);

        current.addOperation(new Operation(nameManager.getPhpName(currentOperation.getName()), returnType, arguments));
    }
View Full Code Here

        XmlSchemaElement outputWrapperElement = (XmlSchemaElement) outputMessagePart.getXmlSchema();
        if (outputWrapperElement == null) {
            outputWrapperElement = XmlSchemaUtils.findElementByRefName(xmlSchemaCollection, outputMessagePart.getElementQName(), serviceInfo.getTargetNamespace());
        }

        return new TypeHint(outputWrapperElement.getMaxOccurs() > 1, nameManager.getAbsolutePhpClassName(outputWrapperElement.getQName()));
    }
View Full Code Here

                for (XmlSchemaObject xmlSchemaObject : choice.getItems()) {
                    ParticleInfo info = ParticleInfo.forLocalItem(xmlSchemaObject, xmlSchema, xmlSchemaCollection, prefixAccumulator, qName);
                    PhpProperty orig = createProperty(info);
                    properties.add(
                            new PhpProperty(
                                    orig.getName(), new TypeHint(true, orig.getTypeHint().getName()), "null", Arrays.<String>asList(), false,
                                    info.getType().getQName().getNamespaceURI()
                            )
                    );
                }
                // Only sort these, others are returned in jaxb order
View Full Code Here

        if (itemInfo.isArray()) {
            comments.add("- array");
            initialValue = "array()";
        }

        TypeHint typeHint;
        if (itemInfo.getType() instanceof XmlSchemaComplexType && itemInfo.getType().isTopLevel()) {
            typeHint = new TypeHint(itemInfo.isArray(), nameManager.getAbsolutePhpClassName(itemInfo.getType().getQName()));
        } else {
            typeHint = new TypeHint(itemInfo.isArray()); // primitive
        }



        if (itemInfo.isNillable())
View Full Code Here

TOP

Related Classes of be.selckin.ws.util.java2php.php.TypeHint

Copyright © 2018 www.massapicom. 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.