1 19 package org.netbeans.modules.db.sql.visualeditor.querymodel; 20 21 24 public class Identifier { 25 26 private String _name; 28 private boolean _delimited; 29 30 31 33 public Identifier(String name, boolean delimited) { 36 _name = name; 37 _delimited = delimited; 38 } 39 40 41 public Identifier(String name) { 44 _name=name; 45 _delimited = needsDelimited(name); 46 } 47 48 49 51 public String genText() { 52 if (_delimited) 53 return "\"" + _name + "\""; 54 else 55 return _name; 56 } 57 58 59 public String getName() { 60 return _name; 61 } 62 63 64 68 private boolean needsDelimited(String name) { 69 String [] split=name.split("\\W"); 70 return (split.length>1); 71 } 72 73 } 74 75 | Popular Tags |