001/* 002 * (C) Copyright 2015 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 * Nicolas Chapurlat <nchapurlat@nuxeo.com> 018 */ 019 020package org.nuxeo.ecm.core.io.registry; 021 022import org.nuxeo.common.xmap.annotation.XNode; 023import org.nuxeo.common.xmap.annotation.XObject; 024 025/** 026 * POJO used to handle "register" {@link MarshallerRegistry} extension point. 027 * 028 * @since 7.2 029 */ 030@XObject("register") 031public class MarshallerRegistryDescriptor { 032 033 @XNode("@class") 034 private Class<?> clazz; 035 036 @XNode("@enable") 037 private boolean enable; 038 039 public MarshallerRegistryDescriptor() { 040 } 041 042 public MarshallerRegistryDescriptor(Class<?> clazz, boolean enable) { 043 super(); 044 this.clazz = clazz; 045 this.enable = enable; 046 } 047 048 public Class<?> getClazz() { 049 return clazz; 050 } 051 052 public void setClazz(Class<?> clazz) { 053 this.clazz = clazz; 054 } 055 056 public boolean isEnable() { 057 return enable; 058 } 059 060 public void setEnable(boolean enable) { 061 this.enable = enable; 062 } 063 064 @Override 065 public String toString() { 066 return clazz.getName() + ":" + Boolean.toString(enable); 067 } 068 069}