@@ -53,14 +53,19 @@ public CharSequence getResult(final DirectFluentBundle bundle, final FluentArgs
5353 return getErrorString ();
5454 }
5555
56- return attribute .getResult (bundle , arguments );
56+ return attribute .getResult (bundle , getArguments ( arguments ) );
5757 }
5858
5959 @ Override
6060 public FluentElement getArgumentResult (final DirectFluentBundle bundle , final FluentArgs arguments ) {
61- final FluentAttribute attribute = this .getMessage (bundle , reference .stringValue ())
62- .getAttribute (this .attributeIdentifier );
63- if (attribute == null ) {
61+ final FluentMessage fluentMessage = this .getMessage (bundle , reference .stringValue ());
62+ if (fluentMessage == null ) {
63+ return this ;
64+ }
65+
66+ final FluentAttribute attribute = fluentMessage .getAttribute (this .attributeIdentifier );
67+
68+ if (attribute == null ) {
6469 return this ;
6570 }
6671
@@ -71,7 +76,7 @@ public FluentElement getArgumentResult(final DirectFluentBundle bundle, final Fl
7176 }
7277
7378 // No recursion (unfortunately :d)
74- return ( FluentElement ) elementList .get (0 );
79+ return elementList .get (0 );
7580 }
7681
7782 protected FluentMessage getMessage (final DirectFluentBundle bundle , final String key ) {
@@ -82,6 +87,10 @@ protected String getErrorString() {
8287 return "{" + reference .stringValue () + "." + attributeIdentifier + "}" ;
8388 }
8489
90+ protected FluentArgs getArguments (final FluentArgs defaultArgs ) {
91+ return defaultArgs ;
92+ }
93+
8594 @ Override
8695 public String toString () {
8796 return "FluentAttributeReference: {\n " +
@@ -91,8 +100,12 @@ public String toString() {
91100 }
92101
93102 public static class TermAttributeReference extends AttributeReference implements FluentSelectable {
94- public TermAttributeReference (FluentPlaceable reference , StringSlice content ) {
103+ private final FluentArgs arguments ;
104+
105+ public TermAttributeReference (final FluentPlaceable reference , final StringSlice content , final FluentArgs arguments ) {
95106 super (reference , content );
107+
108+ this .arguments = arguments ;
96109 }
97110
98111 @ Override
@@ -104,5 +117,19 @@ protected FluentMessage getMessage(final DirectFluentBundle bundle, final String
104117 protected String getErrorString () {
105118 return "{-" + reference .stringValue () + "." + attributeIdentifier + "}" ;
106119 }
120+
121+ @ Override
122+ protected FluentArgs getArguments (final FluentArgs defaultArgs ) {
123+ return this .arguments ;
124+ }
125+
126+ @ Override
127+ public String toString () {
128+ return "FluentTermAttributeReference: {\n " +
129+ "\t \t \t value: \" " + this .reference + "\" \n " +
130+ "\t \t \t attribute: \" " + this .attributeIdentifier + "\" \n " +
131+ "\t \t \t arguments: \" " + this .arguments + "\" \n " +
132+ "\t \t }" ;
133+ }
107134 }
108135}
0 commit comments