diff options
author | bvosburgh | 2007-11-01 20:47:47 +0000 |
---|---|---|
committer | bvosburgh | 2007-11-01 20:47:47 +0000 |
commit | 23f8b1f9cce5728b49ee6d2537a5f071fcc63ceb (patch) | |
tree | decb17dc2e3c993d29bcda77a9ef208aae3600c7 /jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java | |
parent | 7c10dfda5844018faa0d8955308e68aaf2fa7791 (diff) | |
download | webtools.dali-23f8b1f9cce5728b49ee6d2537a5f071fcc63ceb.tar.gz webtools.dali-23f8b1f9cce5728b49ee6d2537a5f071fcc63ceb.tar.xz webtools.dali-23f8b1f9cce5728b49ee6d2537a5f071fcc63ceb.zip |
[201159] model rework
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java new file mode 100644 index 0000000000..ebd80c1da3 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2007 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.utility.internal.model.value; + +/** + * A read-only property value model for when you + * don't need to support a value. + */ +public final class NullPropertyValueModel + extends AbstractReadOnlyPropertyValueModel +{ + + private static final long serialVersionUID = 1L; + + // singleton + private static NullPropertyValueModel INSTANCE; + + /** + * Return the singleton. + */ + public static synchronized PropertyValueModel instance() { + if (INSTANCE == null) { + INSTANCE = new NullPropertyValueModel(); + } + return INSTANCE; + } + + /** + * Ensure non-instantiability. + */ + private NullPropertyValueModel() { + super(); + } + + + // ********** PropertyValueModel implementation ********** + + public Object getValue() { + return null; + } + + + // ********** Object overrides ********** + + @Override + public String toString() { + return "NullPropertyValueModel"; + } + + /** + * Serializable singleton support + */ + private Object readResolve() { + return instance(); + } + +} |