@@ -32,12 +32,20 @@ public class DefaultNode implements Node
3232
3333 private State state = State .UNTOUCHED ;
3434 private Node parentNode ;
35+ private Class <?> valueType ;
3536
36- public DefaultNode (final Node parentNode , final Accessor accessor )
37+ /**
38+ *
39+ * @param parentNode
40+ * @param accessor
41+ * @param valueType
42+ */
43+ public DefaultNode (final Node parentNode , final Accessor accessor , final Class <?> valueType )
3744 {
3845 Assert .notNull (accessor , "accessor" );
3946 this .parentNode = parentNode ;
4047 this .accessor = accessor ;
48+ this .valueType = valueType ;
4149 }
4250
4351 public State getState ()
@@ -108,13 +116,18 @@ public MapNode toMapDifference()
108116 }
109117
110118 @ Override
111- public Class <?> getPropertyType ()
119+ public Class <?> getValueType ()
112120 {
113121 if (accessor instanceof TypeAwareAccessor )
114122 {
115123 return ((TypeAwareAccessor ) accessor ).getPropertyType ();
116124 }
117- return null ;
125+ return valueType ;
126+ }
127+
128+ public void setValueType (final Class <?> valueType )
129+ {
130+ this .valueType = valueType ;
118131 }
119132
120133 public boolean hasChildren ()
@@ -328,9 +341,9 @@ public String toString()
328341 final StringBuilder sb = new StringBuilder ();
329342 sb .append (getPropertyPath ());
330343 sb .append (" = { " ).append (getState ().toString ().toLowerCase ());
331- if (getPropertyType () != null )
344+ if (getValueType () != null )
332345 {
333- sb .append (", type is " ).append (getPropertyType ().getCanonicalName ());
346+ sb .append (", type is " ).append (getValueType ().getCanonicalName ());
334347 }
335348 if (getChildren ().size () == 1 )
336349 {
0 commit comments