001/* 002 * Copyright (c) 2006-2012 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Bogdan Stefanescu 011 * Florent Guillaume 012 */ 013package org.nuxeo.ecm.core.schema.types; 014 015import org.nuxeo.ecm.core.schema.SchemaNames; 016 017/** 018 * Type representing any type (for lists). 019 */ 020public final class AnyType extends AbstractType { 021 022 private static final long serialVersionUID = 1L; 023 024 public static final String ID = "any"; 025 026 public static final AnyType INSTANCE = new AnyType(); 027 028 private AnyType() { 029 super(null, SchemaNames.BUILTIN, ID); 030 } 031 032 @Override 033 public Type getSuperType() { 034 return null; 035 } 036 037 @Override 038 public Type[] getTypeHierarchy() { 039 return EMPTY_SUPERTYPES; 040 } 041 042 @Override 043 public boolean isAnyType() { 044 return true; 045 } 046 047 @Override 048 public boolean validate(Object object) { 049 return true; 050 } 051 052 @Override 053 public Object convert(Object object) { 054 return object; 055 } 056 057 protected Object readResolve() { 058 return INSTANCE; 059 } 060 061}