Package org.milyn.javabean.pojogen

Examples of org.milyn.javabean.pojogen.JNamedType


        if(dataDecoder instanceof DataEncoder) {
            String encoderName = property.getName() + "Encoder";
            Class<? extends DataDecoder> decoderClass = dataDecoder.getClass();

            // Add the property for the encoder instance...
            jClass.getProperties().add(new JNamedType(new JType(decoderClass), encoderName));

            // Create the encoder in the constructor...
            JMethod defaultConstructor = jClass.getDefaultConstructor();
            defaultConstructor.appendToBody("\n        " + encoderName + " = new " + decoderClass.getSimpleName() + "();");
View Full Code Here


     * @param delimiterType Node delimiter type.
     * @throws IllegalNameException when name found in a xmltag-attribute is a java keyword.
     */
    private JNamedType createAndAddSimpleType(ValueNode valueNode, BindingConfig parent, DelimiterType delimiterType) throws IllegalNameException {
        JType jtype;
        JNamedType childToParentProperty;

        if (valueNode.getDataType() != null && !valueNode.getDataType().equals("")) {
            jtype = new JType(valueNode.getTypeClass());
        } else {
            // Default type when no specific type is given.
            jtype = new JType(String.class);
        }

        String propertyName = EDIUtils.encodeAttributeName(jtype, valueNode.getJavaName());
        childToParentProperty = new JNamedType(jtype, propertyName);

        JClass parentBeanClass = parent.getBeanClass();
        if(!parentBeanClass.isFinalized() && !parentBeanClass.hasProperty(propertyName) && model.isClassCreator(parentBeanClass)) {
            parentBeanClass.addBeanProperty(childToParentProperty);
            getWriteMethod(parent).writeValue(childToParentProperty, valueNode, delimiterType);
View Full Code Here

        } else {
            jtype = new JType(child.getSkeletonClass());
        }

        String propertyName = EDIUtils.encodeAttributeName(jtype, mappingNode.getJavaName());
        JNamedType childProperty = new JNamedType(jtype, propertyName);

        BindingConfig childBeanConfig = new BindingConfig(getCurrentClassId(), getCurrentNodePath(), child, parentBinding, childProperty);
        childBeanConfig.setMappingNode(mappingNode);

        JClass parentBeanClass = parentBinding.getBeanClass();
View Full Code Here

TOP

Related Classes of org.milyn.javabean.pojogen.JNamedType

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.