001/* 002 * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Thierry Delprat 018 */ 019package org.nuxeo.ecm.platform.indexing.gateway.ws; 020 021import java.io.Serializable; 022 023import org.nuxeo.ecm.core.schema.DocumentType; 024 025/** 026 * JAXB object for {@link DocumentType} export via WS 027 * 028 * @author tiry 029 */ 030public class DocumentTypeDescriptor implements Serializable { 031 032 /** 033 * 034 */ 035 private static final long serialVersionUID = 1L; 036 037 protected boolean isFile = false; 038 039 protected boolean isFolder = false; 040 041 protected String name; 042 043 protected String[] facets; 044 045 protected String[] schemas; 046 047 public DocumentTypeDescriptor() { 048 049 } 050 051 public DocumentTypeDescriptor(DocumentType docType) { 052 isFile = docType.isFile(); 053 isFolder = docType.isFolder(); 054 name = docType.getName(); 055 facets = docType.getFacets().toArray(new String[docType.getFacets().size()]); 056 schemas = docType.getSchemaNames(); 057 } 058 059 public boolean isFile() { 060 return isFile; 061 } 062 063 public void setFile(boolean isFile) { 064 this.isFile = isFile; 065 } 066 067 public boolean isFolder() { 068 return isFolder; 069 } 070 071 public void setFolder(boolean isFolder) { 072 this.isFolder = isFolder; 073 } 074 075 public String getName() { 076 return name; 077 } 078 079 public void setName(String name) { 080 this.name = name; 081 } 082 083 public String[] getFacets() { 084 return facets; 085 } 086 087 public void setFacets(String[] facets) { 088 this.facets = facets; 089 } 090 091 public String[] getSchemas() { 092 return schemas; 093 } 094 095 public void setSchemas(String[] schemas) { 096 this.schemas = schemas; 097 } 098}