您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

RuleNode.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.vaadin.sass.tree;
  2. import org.w3c.css.sac.LexicalUnit;
  3. public class RuleNode extends Node {
  4. private static final long serialVersionUID = 6653493127869037022L;
  5. String variable;
  6. LexicalUnit value;
  7. String comment;
  8. private boolean important;
  9. public RuleNode(String variable, LexicalUnit value, boolean important,
  10. String comment) {
  11. this.variable = variable;
  12. this.value = value;
  13. this.important = important;
  14. this.comment = comment;
  15. }
  16. public String getVariable() {
  17. return variable;
  18. }
  19. public void setVariable(String variable) {
  20. this.variable = variable;
  21. }
  22. public LexicalUnit getValue() {
  23. return value;
  24. }
  25. public void setValue(LexicalUnit value) {
  26. this.value = value;
  27. }
  28. @Override
  29. public String toString() {
  30. StringBuilder builder = new StringBuilder();
  31. builder.append(variable).append(": ").append(value.toString());
  32. builder.append(important ? " !important;" : ";");
  33. if (comment != null) {
  34. builder.append(comment);
  35. }
  36. return builder.toString();
  37. }
  38. public boolean isImportant() {
  39. return important;
  40. }
  41. public void setImportant(boolean important) {
  42. this.important = important;
  43. }
  44. public String getComment() {
  45. return comment;
  46. }
  47. public void setComment(String comment) {
  48. this.comment = comment;
  49. }
  50. }