summaryrefslogtreecommitdiffstats
path: root/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/PropertyState.java
blob: 95e334f564d951690f6faf0ea6b7c79cfb13b3ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*******************************************************************************
 * Copyright (c) 2009 Elliott Baron
 * 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:
 *    Elliott Baron - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.codan.extension;

import org.eclipse.cdt.core.dom.ast.IASTNode;

public abstract class PropertyState {
	
	private String name;
	
	public PropertyState() {
		this(null);
	}
	
	public PropertyState(String name) {
		this.name = name;
	}
	
	public abstract PropertyState transition(IASTNode node);
	
	@Override
	public String toString() {
		String ret;
		if (name != null) {
			ret = name;
		}
		else {
			ret = super.toString();
		}
		return ret;
	}
	
}