chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1460393 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
Date Sun, 24 Mar 2013 15:11:26 GMT
Author: jens
Date: Sun Mar 24 15:11:25 2013
New Revision: 1460393

URL: http://svn.apache.org/r1460393
Log:
InMemory: add missing file for JAXB removal

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=1460393&r1=1460392&r2=1460393&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
Sun Mar 24 15:11:25 2013
@@ -124,23 +124,6 @@ public class TypeValidator {
             return null;        
     }
 
-    public static TypeDefinition cloneType(TypeDefinition type) {
-        if (type instanceof DocumentTypeDefinition)
-            return cloneTypeDoc((DocumentTypeDefinition) type);
-        else if (type instanceof FolderTypeDefinition)
-            return cloneTypeFolder((FolderTypeDefinition) type);
-        else if (type instanceof PolicyTypeDefinition)
-            return cloneTypePolicy((PolicyTypeDefinition) type);
-        else if (type instanceof ItemTypeDefinition)
-            return cloneTypeItem((ItemTypeDefinition) type);
-        else if (type instanceof RelationshipTypeDefinition)
-            return cloneTypeRelationship((RelationshipTypeDefinition) type);
-        else if (type instanceof SecondaryTypeDefinition)
-            return cloneTypeSecondary((SecondaryTypeDefinition) type);
-        else
-            return null;        
-    }
-
     public static void adjustTypeNamesAndId(AbstractTypeDefinition typeDef) {
         if (null == typeDef.getId()) {
             typeDef.setId(UUID.randomUUID().toString());
@@ -264,7 +247,7 @@ public class TypeValidator {
     }
 
     private static DocumentTypeDefinitionImpl completeTypeDoc(DocumentTypeDefinition type)
{
-        DocumentTypeDefinitionImpl td = cloneTypeDoc(type);
+        DocumentTypeDefinitionImpl td = TypeUtil.cloneTypeDoc(type);
         completeAbstractTypeDefinition(td);
         td.setIsVersionable(type.isVersionable());
         td.setContentStreamAllowed(type.getContentStreamAllowed());
@@ -275,80 +258,39 @@ public class TypeValidator {
         return td;
     }
 
-    private static DocumentTypeDefinitionImpl cloneTypeDoc(DocumentTypeDefinition type) {
-        DocumentTypeDefinitionImpl td = new DocumentTypeDefinitionImpl();
-        td.initialize(type);
-        completeAbstractTypeDefinition(td);
-        td.setIsVersionable(type.isVersionable());
-        td.setContentStreamAllowed(type.getContentStreamAllowed());
-        return td;
-    }
-
     private static FolderTypeDefinitionImpl completeTypeFolder(FolderTypeDefinition type)
{
-        FolderTypeDefinitionImpl td = cloneTypeFolder(type);
+        FolderTypeDefinitionImpl td = TypeUtil.cloneTypeFolder(type);
         completeAbstractTypeDefinition(td);
         return td;
     }
 
-    private static FolderTypeDefinitionImpl cloneTypeFolder(FolderTypeDefinition type) {
-        FolderTypeDefinitionImpl td = new FolderTypeDefinitionImpl();
-        td.initialize(type);
-        return td;
-    }
-
     private static RelationshipTypeDefinitionImpl completeTypeRelationship(RelationshipTypeDefinition
type) {
-        RelationshipTypeDefinitionImpl td = cloneTypeRelationship(type);
+        RelationshipTypeDefinitionImpl td = TypeUtil.cloneTypeRelationship(type);
         completeAbstractTypeDefinition(td);
         td.setAllowedSourceTypes(type.getAllowedSourceTypeIds());
         td.setAllowedTargetTypes(type.getAllowedTargetTypeIds());
         return td;
     }
 
-    private static RelationshipTypeDefinitionImpl cloneTypeRelationship(RelationshipTypeDefinition
type) {
-        RelationshipTypeDefinitionImpl td = new RelationshipTypeDefinitionImpl();
-        td.initialize(type);
-        td.setAllowedSourceTypes(type.getAllowedSourceTypeIds());
-        td.setAllowedTargetTypes(type.getAllowedTargetTypeIds());
-        return td;
-    }
-
     private static ItemTypeDefinitionImpl completeTypeItem(ItemTypeDefinition type) {
-        ItemTypeDefinitionImpl td = cloneTypeItem(type);
+        ItemTypeDefinitionImpl td = TypeUtil.cloneTypeItem(type);
         td.initialize(type);
         completeAbstractTypeDefinition(td);
         return td;        
     }
 
-    private static ItemTypeDefinitionImpl cloneTypeItem(ItemTypeDefinition type) {
-        ItemTypeDefinitionImpl td = new ItemTypeDefinitionImpl();
-        td.initialize(type);
-        return td;        
-    }
-    
     private static SecondaryTypeDefinitionImpl completeTypeSecondary(SecondaryTypeDefinition
type) {
-        SecondaryTypeDefinitionImpl td = cloneTypeSecondary(type);
+        SecondaryTypeDefinitionImpl td = TypeUtil.cloneTypeSecondary(type);
         completeAbstractTypeDefinition(td);
         return td;        
     }
 
-    private static SecondaryTypeDefinitionImpl cloneTypeSecondary(SecondaryTypeDefinition
type) {
-        SecondaryTypeDefinitionImpl td = new SecondaryTypeDefinitionImpl();
-        td.initialize(type);
-        return td;        
-    }
-    
     private static PolicyTypeDefinitionImpl completeTypePolicy(PolicyTypeDefinition type)
{
-        PolicyTypeDefinitionImpl td = cloneTypePolicy(type);
+        PolicyTypeDefinitionImpl td = TypeUtil.cloneTypePolicy(type);
         completeAbstractTypeDefinition(td);
         return null;
     }
 
-    private static PolicyTypeDefinitionImpl cloneTypePolicy(PolicyTypeDefinition type) {
-        PolicyTypeDefinitionImpl td = new PolicyTypeDefinitionImpl();
-        td.initialize(td);
-        return null;
-    }
-
     // When creating types PropertyDefinitions may only be partially filled, fill all fields
     // to make a complete definition
     private static AbstractPropertyDefinition<?> completePropertyDef(PropertyDefinition<?>
pdSrc) {



Mime
View raw message