Package liquibase.serializer

Examples of liquibase.serializer.LiquibaseSerializable


                                }
                            }
                        } else if (LiquibaseSerializable.class.isAssignableFrom(collectionType)) {
                            List<ParsedNode> childNodes = new ArrayList<ParsedNode>(parsedNode.getChildren(null, param.getParameterName()));
                            for (ParsedNode childNode : childNodes) {
                                LiquibaseSerializable childObject = (LiquibaseSerializable) collectionType.newInstance();
                                childObject.load(childNode, resourceAccessor);

                                ((Collection) param.getCurrentValue(this)).add(childObject);

                            }
                        }
                    }
                } else if (LiquibaseSerializable.class.isAssignableFrom(param.getDataTypeClass())) {
                    try {
                        ParsedNode child = parsedNode.getChild(null, param.getParameterName());
                        if (child != null) {
                            LiquibaseSerializable serializableChild = (LiquibaseSerializable) param.getDataTypeClass().newInstance();
                            serializableChild.load(child, resourceAccessor);
                            param.setValue(this, serializableChild);
                        }
                    } catch (InstantiationException e) {
                        throw new UnexpectedLiquibaseException(e);
                    } catch (IllegalAccessException e) {
View Full Code Here



        @Override
        protected Set<Property> getProperties(Class<? extends Object> type) throws IntrospectionException {
            Set<Property> returnSet = new HashSet<Property>();
            LiquibaseSerializable serialzableType = null;
            try {
                if (type.equals(ChangeSet.class)) {
                    serialzableType = new ChangeSet("x", "y", false, false, null, null, null, null);
                } else if (LiquibaseSerializable.class.isAssignableFrom(type)) {
                    serialzableType = (LiquibaseSerializable) type.newInstance();
                } else {
                    return super.getProperties(type);
                }
            } catch (InstantiationException e) {
                throw new UnexpectedLiquibaseException(e);
            } catch (IllegalAccessException e) {
                throw new UnexpectedLiquibaseException(e);
            }
            for (String property : serialzableType.getSerializableFields()) {
                LiquibaseSerializable.SerializationType fieldType = serialzableType.getSerializableFieldType(property);
                returnSet.add(new LiquibaseProperty(property, String.class, String.class));
            }
            return returnSet;
        }
View Full Code Here

TOP

Related Classes of liquibase.serializer.LiquibaseSerializable

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.