01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.config.schema;
05:
06: import com.tc.util.Assert;
07: import com.tc.util.stringification.OurStringBuilder;
08:
09: /**
10: * An {@link InstrumentedClass} that represents an excluded class.
11: */
12: public class ExcludedInstrumentedClass implements InstrumentedClass {
13:
14: private final String classExpression;
15:
16: public ExcludedInstrumentedClass(String classExpression) {
17: Assert.assertNotBlank(classExpression);
18:
19: this .classExpression = classExpression;
20: }
21:
22: public boolean isInclude() {
23: return false;
24: }
25:
26: public String classExpression() {
27: return this .classExpression;
28: }
29:
30: public boolean honorTransient() {
31: throw Assert
32: .failure("Honor-transient has no meaning on excluded classes");
33: }
34:
35: public boolean honorVolatile() {
36: throw Assert
37: .failure("Honor-volatile has no meaning on excluded classes");
38: }
39:
40: public boolean callConstructorOnLoad() {
41: throw Assert
42: .failure("Call-constructor-on-load has no meaning on excluded classes");
43: }
44:
45: public IncludeOnLoad onLoad() {
46: throw Assert
47: .failure("Call-constructor-on-load has no meaning on excluded classes");
48: }
49:
50: public String toString() {
51: return new OurStringBuilder(this ,
52: OurStringBuilder.COMPACT_STYLE).append(
53: "classExpression", this.classExpression).toString();
54: }
55: }
|