private boolean validateNames() { if (!Logging.isLoggable(Logging.LST_WARNING)) { return true; } for (String key : active.keySet()) { T value = active.get(key); if (value.isInternal()) { continue; } /* * http://wiki.pcgen.org/index.php?title=Data_LST_Standards * * Characters which should never be used in object names are Commas * (,), Pipes (|), Backslashes (\), Colons (:), Semicolons (;), * Periods (.), Brackets ([]), Percent (%), Asterisk (*) and Equals * (=). */ if (key.indexOf(',') != -1 && factory.getReferenceClass() != RollMethod.class) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a comma " + "(prohibited character in a key)"); } if (key.indexOf('|') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a pipe " + "(prohibited character in a key)"); } if (key.indexOf('\\') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a backslash " + "(prohibited character in a key)"); } if (key.indexOf(':') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a colon " + "(prohibited character in a key)"); } if (key.indexOf(';') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a semicolon " + "(prohibited character in a key)"); } // if (key.indexOf('.') != -1) // { // Logging.log(Logging.LST_WARNING, "Found " // + getReferenceDescription() + " with KEY: " + key // + " which contains a period " // + "(prohibited character in a key)"); // } if (key.indexOf('%') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a percent sign " + "(prohibited character in a key)"); } if (key.indexOf('*') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains an asterisk " + "(prohibited character in a key)"); } if (key.indexOf('=') != -1) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains an equals sign " + "(prohibited character in a key)"); } if ((key.indexOf('[') != -1) || (key.indexOf(']') != -1)) { Logging.log( Logging.LST_WARNING, "Found " + factory.getReferenceDescription() + " with KEY: " + key + " which contains a bracket " + "(prohibited character in a key)"); } } return true; }
/** * The class of object this AbstractReferenceManufacturer represents. * * @return The class of object this AbstractReferenceManufacturer represents. */ @Override public Class<T> getReferenceClass() { return factory.getReferenceClass(); }