Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package com.sun.xml.bind.v2;
  2.  
  3. import java.text.MessageFormat;
  4. import java.util.ResourceBundle;
  5.  
  6. /**
  7. * Formats error messages.
  8. */
  9. enum Messages {
  10. ILLEGAL_ENTRY, // 1 arg
  11. ERROR_LOADING_CLASS, // 2 args
  12. INVALID_PROPERTY_VALUE, // 2 args
  13. UNSUPPORTED_PROPERTY, // 1 arg
  14. BROKEN_CONTEXTPATH, // 1 arg
  15. NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS, // 1 arg
  16. INVALID_TYPE_IN_MAP, // 0args
  17. ;
  18.  
  19. private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
  20.  
  21. public String toString() {
  22. return format();
  23. }
  24.  
  25. public String format( Object... args ) {
  26. return MessageFormat.format( rb.getString(name()), args );
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement