Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 Michael Ruflin, Andr´┐Ż Locher, Claudia von Bastian. This file is part of Tatool. Tatool is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Tatool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Tatool. If not, see <>. /
Integer value property object

Michael Ruflin
public class IntegerProperty extends GenericProperty<Integer> {

Default value to return in getValueOrDefault.
	private Integer defaultValue = null;
	public IntegerProperty(String propertyName) {
	public IntegerProperty(String propertyNameInteger defaultValue) {
		this. = defaultValue;
	public Integer ensureValue(DataContainer dataContainerString nodeId) {
		if ( != null) {
			return ensureValue(dataContainernodeId);
else {
			throw new UnsupportedOperationException("A default value needs to be defined prior to be able to use this method");

Returns the stored value of the defaultValue stored in this class.
	public Integer getValueOrDefault(Node node) {
		return getValue(node);
New to GrepCode? Check out our FAQ X