------------------------------------------------------------ revno: 14210 committer: Morten Olav Hansen <morte...@gmail.com> branch nick: dhis2 timestamp: Thu 2014-03-13 15:30:24 +0100 message: moved schema into its own package in service-dxf2 removed: dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Property.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Schema.java added: dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Property.java dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Schema.java
-- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Property.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Property.java 2014-03-13 14:27:16 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Property.java 1970-01-01 00:00:00 +0000 @@ -1,175 +0,0 @@ -package org.hisp.dhis.dxf2.common; - -/* - * Copyright (c) 2004-2013, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.lang.reflect.Method; - -/** - * @author Morten Olav Hansen <morte...@gmail.com> - */ -public class Property -{ - private String name; - - private String description; - - private String xmlName; - - private boolean xmlAttribute; - - private String xmlCollectionName; - - private Class<?> clazz; - - private Method method; - - private boolean collection; - - private boolean identifiableObject; - - private Property( Method method ) - { - this.method = method; - } - - @JsonProperty - public String getName() - { - return name; - } - - public void setName( String name ) - { - this.name = name; - } - - @JsonProperty - public String getDescription() - { - return description; - } - - public void setDescription( String description ) - { - this.description = description; - } - - @JsonProperty - public String getXmlName() - { - return xmlName; - } - - public void setXmlName( String xmlName ) - { - this.xmlName = xmlName; - } - - @JsonProperty - public boolean isXmlAttribute() - { - return xmlAttribute; - } - - public void setXmlAttribute( boolean xmlAttribute ) - { - this.xmlAttribute = xmlAttribute; - } - - @JsonProperty - public String getXmlCollectionName() - { - return xmlCollectionName; - } - - public void setXmlCollectionName( String xmlCollectionName ) - { - this.xmlCollectionName = xmlCollectionName; - } - - @JsonProperty - public Class<?> getClazz() - { - return clazz; - } - - public void setClazz( Class<?> clazz ) - { - this.clazz = clazz; - } - - public Method getMethod() - { - return method; - } - - public void setMethod( Method method ) - { - this.method = method; - } - - @JsonProperty - public boolean isCollection() - { - return collection; - } - - public void setCollection( boolean collection ) - { - this.collection = collection; - } - - @JsonProperty - public boolean isIdentifiableObject() - { - return identifiableObject; - } - - public void setIdentifiableObject( boolean identifiableObject ) - { - this.identifiableObject = identifiableObject; - } - - @Override public String toString() - { - return "PropertyDescriptor{" + - "name='" + name + '\'' + - ", description='" + description + '\'' + - ", xmlName='" + xmlName + '\'' + - ", xmlAttribute=" + xmlAttribute + - ", xmlCollectionName='" + xmlCollectionName + '\'' + - ", clazz=" + clazz + - ", method=" + method + - ", collection=" + collection + - ", identifiableObject=" + identifiableObject + - '}'; - } -} === removed file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Schema.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Schema.java 2014-03-13 14:27:16 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/Schema.java 1970-01-01 00:00:00 +0000 @@ -1,153 +0,0 @@ -package org.hisp.dhis.dxf2.common; - -/* - * Copyright (c) 2004-2013, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import com.google.common.collect.Lists; -import org.hisp.dhis.common.DxfNamespaces; - -import java.util.List; - -/** - * @author Morten Olav Hansen <morte...@gmail.com> - */ -@JacksonXmlRootElement( localName = "schema", namespace = DxfNamespaces.DXF_2_0 ) -public class Schema -{ - private Class<?> klass; - - private String singular; - - private String plural; - - private boolean importable; - - private boolean exportable; - - private boolean deletable; - - private List<Property> properties = Lists.newArrayList(); - - public Schema() - { - } - - public Schema( Class<?> klass, String singular, String plural, boolean importable, boolean exportable, boolean deletable ) - { - this.klass = klass; - this.singular = singular; - this.plural = plural; - this.importable = importable; - this.exportable = exportable; - this.deletable = deletable; - } - - @JsonProperty - @JacksonXmlProperty( isAttribute = true, namespace = DxfNamespaces.DXF_2_0 ) - public Class<?> getKlass() - { - return klass; - } - - public void setKlass( Class<?> klass ) - { - this.klass = klass; - } - - @JsonProperty - public String getSingular() - { - return singular; - } - - public void setSingular( String singular ) - { - this.singular = singular; - } - - @JsonProperty - public String getPlural() - { - return plural; - } - - public void setPlural( String plural ) - { - this.plural = plural; - } - - @JsonProperty - public boolean isImportable() - { - return importable; - } - - public void setImportable( boolean importable ) - { - this.importable = importable; - } - - @JsonProperty - public boolean isExportable() - { - return exportable; - } - - public void setExportable( boolean exportable ) - { - this.exportable = exportable; - } - - @JsonProperty - public boolean isDeletable() - { - return deletable; - } - - public void setDeletable( boolean deletable ) - { - this.deletable = deletable; - } - - @JsonProperty - @JacksonXmlElementWrapper( localName = "properties", namespace = DxfNamespaces.DXF_2_0 ) - @JacksonXmlProperty( localName = "property", namespace = DxfNamespaces.DXF_2_0 ) - public List<Property> getProperties() - { - return properties; - } - - public void setProperties( List<Property> properties ) - { - this.properties = properties; - } -} === added directory 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema' === added file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Property.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Property.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Property.java 2014-03-13 14:30:24 +0000 @@ -0,0 +1,175 @@ +package org.hisp.dhis.dxf2.schema; + +/* + * Copyright (c) 2004-2013, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.lang.reflect.Method; + +/** + * @author Morten Olav Hansen <morte...@gmail.com> + */ +public class Property +{ + private String name; + + private String description; + + private String xmlName; + + private boolean xmlAttribute; + + private String xmlCollectionName; + + private Class<?> clazz; + + private Method method; + + private boolean collection; + + private boolean identifiableObject; + + private Property( Method method ) + { + this.method = method; + } + + @JsonProperty + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + @JsonProperty + public String getDescription() + { + return description; + } + + public void setDescription( String description ) + { + this.description = description; + } + + @JsonProperty + public String getXmlName() + { + return xmlName; + } + + public void setXmlName( String xmlName ) + { + this.xmlName = xmlName; + } + + @JsonProperty + public boolean isXmlAttribute() + { + return xmlAttribute; + } + + public void setXmlAttribute( boolean xmlAttribute ) + { + this.xmlAttribute = xmlAttribute; + } + + @JsonProperty + public String getXmlCollectionName() + { + return xmlCollectionName; + } + + public void setXmlCollectionName( String xmlCollectionName ) + { + this.xmlCollectionName = xmlCollectionName; + } + + @JsonProperty + public Class<?> getClazz() + { + return clazz; + } + + public void setClazz( Class<?> clazz ) + { + this.clazz = clazz; + } + + public Method getMethod() + { + return method; + } + + public void setMethod( Method method ) + { + this.method = method; + } + + @JsonProperty + public boolean isCollection() + { + return collection; + } + + public void setCollection( boolean collection ) + { + this.collection = collection; + } + + @JsonProperty + public boolean isIdentifiableObject() + { + return identifiableObject; + } + + public void setIdentifiableObject( boolean identifiableObject ) + { + this.identifiableObject = identifiableObject; + } + + @Override public String toString() + { + return "PropertyDescriptor{" + + "name='" + name + '\'' + + ", description='" + description + '\'' + + ", xmlName='" + xmlName + '\'' + + ", xmlAttribute=" + xmlAttribute + + ", xmlCollectionName='" + xmlCollectionName + '\'' + + ", clazz=" + clazz + + ", method=" + method + + ", collection=" + collection + + ", identifiableObject=" + identifiableObject + + '}'; + } +} === added file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Schema.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Schema.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/schema/Schema.java 2014-03-13 14:30:24 +0000 @@ -0,0 +1,153 @@ +package org.hisp.dhis.dxf2.schema; + +/* + * Copyright (c) 2004-2013, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.google.common.collect.Lists; +import org.hisp.dhis.common.DxfNamespaces; + +import java.util.List; + +/** + * @author Morten Olav Hansen <morte...@gmail.com> + */ +@JacksonXmlRootElement( localName = "schema", namespace = DxfNamespaces.DXF_2_0 ) +public class Schema +{ + private Class<?> klass; + + private String singular; + + private String plural; + + private boolean importable; + + private boolean exportable; + + private boolean deletable; + + private List<Property> properties = Lists.newArrayList(); + + public Schema() + { + } + + public Schema( Class<?> klass, String singular, String plural, boolean importable, boolean exportable, boolean deletable ) + { + this.klass = klass; + this.singular = singular; + this.plural = plural; + this.importable = importable; + this.exportable = exportable; + this.deletable = deletable; + } + + @JsonProperty + @JacksonXmlProperty( isAttribute = true, namespace = DxfNamespaces.DXF_2_0 ) + public Class<?> getKlass() + { + return klass; + } + + public void setKlass( Class<?> klass ) + { + this.klass = klass; + } + + @JsonProperty + public String getSingular() + { + return singular; + } + + public void setSingular( String singular ) + { + this.singular = singular; + } + + @JsonProperty + public String getPlural() + { + return plural; + } + + public void setPlural( String plural ) + { + this.plural = plural; + } + + @JsonProperty + public boolean isImportable() + { + return importable; + } + + public void setImportable( boolean importable ) + { + this.importable = importable; + } + + @JsonProperty + public boolean isExportable() + { + return exportable; + } + + public void setExportable( boolean exportable ) + { + this.exportable = exportable; + } + + @JsonProperty + public boolean isDeletable() + { + return deletable; + } + + public void setDeletable( boolean deletable ) + { + this.deletable = deletable; + } + + @JsonProperty + @JacksonXmlElementWrapper( localName = "properties", namespace = DxfNamespaces.DXF_2_0 ) + @JacksonXmlProperty( localName = "property", namespace = DxfNamespaces.DXF_2_0 ) + public List<Property> getProperties() + { + return properties; + } + + public void setProperties( List<Property> properties ) + { + this.properties = properties; + } +}
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp