We propose a new formal modeling language for the specification of interfaces in Java in terms of communication histories, i.e., sequences of messages. We show how attribute grammars provide a powerful separation of concerns between high-level protocol-oriented properties, which focus on the kind of messages sent and received, and data-oriented properties, which focus on the actual data communicated. We develop a modeling framework in Java for the integration of attribute grammars in the Java Modeling Language and discuss the corresponding tool-support for run-time assertion checking. Further, we investigate the static analysis of histories specified by attribute grammars by means of theorem proving techniques.