Package org.drools.ide.common.shared.workitems

Examples of org.drools.ide.common.shared.workitems.PortableParameterDefinition


    private Set<PortableParameterDefinition> convertWorkItemParameters(Set<ParameterDefinition> parameters) {
        Set<PortableParameterDefinition> pps = new HashSet<PortableParameterDefinition>();
        for ( ParameterDefinition pd : parameters ) {
            DataType pdt = pd.getType();
            PortableParameterDefinition ppd = null;
            if ( pdt instanceof BooleanDataType ) {
                ppd = new PortableBooleanParameterDefinition();
            } else if ( pdt instanceof FloatDataType ) {
                ppd = new PortableFloatParameterDefinition();
            } else if ( pdt instanceof IntegerDataType ) {
                ppd = new PortableIntegerParameterDefinition();
            } else if ( pdt instanceof ListDataType ) {
                //TODO ListDataType
                //ppd = new PortableListParameterDefinition();
            } else if ( pdt instanceof ObjectDataType ) {
                ppd = new PortableObjectParameterDefinition();
                PortableObjectParameterDefinition oppd = (PortableObjectParameterDefinition) ppd;
                ObjectDataType odt = (ObjectDataType) pdt;
                oppd.setClassName( odt.getClassName() );
            } else if ( pd.getType() instanceof StringDataType ) {
                ppd = new PortableStringParameterDefinition();
            } else if ( pdt instanceof EnumDataType ) {
                //TODO EnumDataType
                //ppd = new PortableEnumParameterDefinition();
                //PortableEnumParameterDefinition eppd = (PortableEnumParameterDefinition) ppd;
                //EnumDataType epdt = (EnumDataType) pdt;
                //eppd.setClassName( epdt.getClassName() );
                //if ( epdt.getValueMap() != null ) {
                //    eppd.setValues( epdt.getValueNames() );
                //}
            }
            if ( ppd != null ) {
                ppd.setName( pd.getName() );
                pps.add( ppd );
            }
        }
        return pps;
    }
View Full Code Here


    private Set<PortableParameterDefinition> convertWorkItemParameters(Set<ParameterDefinition> parameters) {
        Set<PortableParameterDefinition> pps = new HashSet<PortableParameterDefinition>();
        for ( ParameterDefinition pd : parameters ) {
            DataType pdt = pd.getType();
            PortableParameterDefinition ppd = null;
            if ( pdt instanceof BooleanDataType ) {
                ppd = new PortableBooleanParameterDefinition();
            } else if ( pdt instanceof FloatDataType ) {
                ppd = new PortableFloatParameterDefinition();
            } else if ( pdt instanceof IntegerDataType ) {
                ppd = new PortableIntegerParameterDefinition();
            } else if ( pdt instanceof ListDataType ) {
                //TODO ListDataType
                //ppd = new PortableListParameterDefinition();
            } else if ( pdt instanceof ObjectDataType ) {
                ppd = new PortableObjectParameterDefinition();
                PortableObjectParameterDefinition oppd = (PortableObjectParameterDefinition) ppd;
                ObjectDataType odt = (ObjectDataType) pdt;
                oppd.setClassName( odt.getClassName() );
            } else if ( pd.getType() instanceof StringDataType ) {
                ppd = new PortableStringParameterDefinition();
            } else if ( pdt instanceof EnumDataType ) {
                //TODO EnumDataType
                //ppd = new PortableEnumParameterDefinition();
                //PortableEnumParameterDefinition eppd = (PortableEnumParameterDefinition) ppd;
                //EnumDataType epdt = (EnumDataType) pdt;
                //eppd.setClassName( epdt.getClassName() );
                //if ( epdt.getValueMap() != null ) {
                //    eppd.setValues( epdt.getValueNames() );
                //}
            }
            if ( ppd != null ) {
                ppd.setName( pd.getName() );
                pps.add( ppd );
            }
        }
        return pps;
    }
View Full Code Here

        }
        return clone;
    }

    private PortableParameterDefinition cloneParameter(PortableParameterDefinition ppd) {
        PortableParameterDefinition clone = null;
        if ( ppd instanceof PortableBooleanParameterDefinition ) {
            clone = new PortableBooleanParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableBooleanParameterDefinition) clone).setBinding( ((PortableBooleanParameterDefinition) ppd).getBinding() );
            ((PortableBooleanParameterDefinition) clone).setValue( ((PortableBooleanParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableEnumParameterDefinition ) {
            clone = new PortableEnumParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableEnumParameterDefinition) clone).setClassName( ((PortableEnumParameterDefinition) ppd).getClassName() );
            ((PortableEnumParameterDefinition) clone).setBinding( ((PortableEnumParameterDefinition) ppd).getBinding() );
            ((PortableEnumParameterDefinition) clone).setValues( ((PortableEnumParameterDefinition) ppd).getValues() );
            ((PortableEnumParameterDefinition) clone).setValue( ((PortableEnumParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableFloatParameterDefinition ) {
            clone = new PortableFloatParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableFloatParameterDefinition) clone).setBinding( ((PortableFloatParameterDefinition) ppd).getBinding() );
            ((PortableFloatParameterDefinition) clone).setValue( ((PortableFloatParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableIntegerParameterDefinition ) {
            clone = new PortableIntegerParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableIntegerParameterDefinition) clone).setBinding( ((PortableIntegerParameterDefinition) ppd).getBinding() );
            ((PortableIntegerParameterDefinition) clone).setValue( ((PortableIntegerParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableListParameterDefinition ) {
            clone = new PortableListParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableListParameterDefinition) clone).setBinding( ((PortableListParameterDefinition) ppd).getBinding() );
            ((PortableListParameterDefinition) clone).setClassName( ((PortableListParameterDefinition) ppd).getClassName() );
            return clone;
        } else if ( ppd instanceof PortableObjectParameterDefinition ) {
            clone = new PortableObjectParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableObjectParameterDefinition) clone).setBinding( ((PortableObjectParameterDefinition) ppd).getBinding() );
            ((PortableObjectParameterDefinition) clone).setClassName( ((PortableObjectParameterDefinition) ppd).getClassName() );
            return clone;
        } else if ( ppd instanceof PortableStringParameterDefinition ) {
            clone = new PortableStringParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableStringParameterDefinition) clone).setBinding( ((PortableStringParameterDefinition) ppd).getBinding() );
            ((PortableStringParameterDefinition) clone).setValue( ((PortableStringParameterDefinition) ppd).getValue() );
            return clone;
        }
        throw new IllegalArgumentException( "Unrecognized PortableParameterDefinition" );
View Full Code Here

        }
        return clone;
    }

    private PortableParameterDefinition cloneParameter(PortableParameterDefinition ppd) {
        PortableParameterDefinition clone = null;
        if ( ppd instanceof PortableBooleanParameterDefinition ) {
            clone = new PortableBooleanParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableBooleanParameterDefinition) clone).setBinding( ((PortableBooleanParameterDefinition) ppd).getBinding() );
            ((PortableBooleanParameterDefinition) clone).setValue( ((PortableBooleanParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableEnumParameterDefinition ) {
            clone = new PortableEnumParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableEnumParameterDefinition) clone).setClassName( ((PortableEnumParameterDefinition) ppd).getClassName() );
            ((PortableEnumParameterDefinition) clone).setBinding( ((PortableEnumParameterDefinition) ppd).getBinding() );
            ((PortableEnumParameterDefinition) clone).setValues( ((PortableEnumParameterDefinition) ppd).getValues() );
            ((PortableEnumParameterDefinition) clone).setValue( ((PortableEnumParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableFloatParameterDefinition ) {
            clone = new PortableFloatParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableFloatParameterDefinition) clone).setBinding( ((PortableFloatParameterDefinition) ppd).getBinding() );
            ((PortableFloatParameterDefinition) clone).setValue( ((PortableFloatParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableIntegerParameterDefinition ) {
            clone = new PortableIntegerParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableIntegerParameterDefinition) clone).setBinding( ((PortableIntegerParameterDefinition) ppd).getBinding() );
            ((PortableIntegerParameterDefinition) clone).setValue( ((PortableIntegerParameterDefinition) ppd).getValue() );
            return clone;
        } else if ( ppd instanceof PortableListParameterDefinition ) {
            clone = new PortableListParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableListParameterDefinition) clone).setBinding( ((PortableListParameterDefinition) ppd).getBinding() );
            ((PortableListParameterDefinition) clone).setClassName( ((PortableListParameterDefinition) ppd).getClassName() );
            return clone;
        } else if ( ppd instanceof PortableObjectParameterDefinition ) {
            clone = new PortableObjectParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableObjectParameterDefinition) clone).setBinding( ((PortableObjectParameterDefinition) ppd).getBinding() );
            ((PortableObjectParameterDefinition) clone).setClassName( ((PortableObjectParameterDefinition) ppd).getClassName() );
            return clone;
        } else if ( ppd instanceof PortableStringParameterDefinition ) {
            clone = new PortableStringParameterDefinition();
            clone.setName( ppd.getName() );
            ((PortableStringParameterDefinition) clone).setBinding( ((PortableStringParameterDefinition) ppd).getBinding() );
            ((PortableStringParameterDefinition) clone).setValue( ((PortableStringParameterDefinition) ppd).getValue() );
            return clone;
        }
        throw new IllegalArgumentException( "Unrecognized PortableParameterDefinition" );
View Full Code Here

    private Set<PortableParameterDefinition> convertWorkItemParameters(Set<ParameterDefinition> parameters) {
        Set<PortableParameterDefinition> pps = new HashSet<PortableParameterDefinition>();
        for ( ParameterDefinition pd : parameters ) {
            DataType pdt = pd.getType();
            PortableParameterDefinition ppd = null;
            if ( pdt instanceof BooleanDataType ) {
                ppd = new PortableBooleanParameterDefinition();
            } else if ( pdt instanceof FloatDataType ) {
                ppd = new PortableFloatParameterDefinition();
            } else if ( pdt instanceof IntegerDataType ) {
                ppd = new PortableIntegerParameterDefinition();
            } else if ( pdt instanceof ListDataType ) {
                //TODO ListDataType
                //ppd = new PortableListParameterDefinition();
            } else if ( pdt instanceof ObjectDataType ) {
                ppd = new PortableObjectParameterDefinition();
                PortableObjectParameterDefinition oppd = (PortableObjectParameterDefinition) ppd;
                ObjectDataType odt = (ObjectDataType) pdt;
                oppd.setClassName( odt.getClassName() );
            } else if ( pd.getType() instanceof StringDataType ) {
                ppd = new PortableStringParameterDefinition();
            } else if ( pdt instanceof EnumDataType ) {
                //TODO EnumDataType
                //ppd = new PortableEnumParameterDefinition();
                //PortableEnumParameterDefinition eppd = (PortableEnumParameterDefinition) ppd;
                //EnumDataType epdt = (EnumDataType) pdt;
                //eppd.setClassName( epdt.getClassName() );
                //if ( epdt.getValueMap() != null ) {
                //    eppd.setValues( epdt.getValueNames() );
                //}
            }
            if ( ppd != null ) {
                ppd.setName( pd.getName() );
                pps.add( ppd );
            }
        }
        return pps;
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.shared.workitems.PortableParameterDefinition

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.