public ResName(@Nonnull String packageName, @Nonnull String type, @Nonnull String name) { this.packageName = packageName; this.type = type.trim(); this.name = name.trim(); hashCode = computeHashCode(); }
public ResName(@Nonnull String fullyQualifiedName) { Matcher matcher = FQN_PATTERN.matcher(fullyQualifiedName.trim()); if (!matcher.find()) { throw new IllegalStateException("\"" + fullyQualifiedName + "\" is not fully qualified"); } packageName = matcher.group(NAMESPACE); type = matcher.group(TYPE).trim(); name = matcher.group(NAME).trim(); hashCode = computeHashCode(); if (packageName.equals("xmlns")) throw new IllegalStateException("\"" + fullyQualifiedName + "\" unexpected"); }
public ResName(@Nonnull String packageName, @Nonnull String type, @Nonnull String name) { this.packageName = packageName; this.type = type.trim(); this.name = name.trim(); hashCode = computeHashCode(); }
public ResName(@NotNull String packageName, @NotNull String type, @NotNull String name) { this.packageName = packageName; this.type = type.trim(); this.name = name.indexOf('.') != -1 ? name.replace('.', '_').trim() : name.trim(); hashCode = computeHashCode(); }
public ResName(@Nonnull String fullyQualifiedName) { Matcher matcher = FQN_PATTERN.matcher(fullyQualifiedName.trim()); if (!matcher.find()) { throw new IllegalStateException("\"" + fullyQualifiedName + "\" is not fully qualified"); } packageName = matcher.group(NAMESPACE); type = matcher.group(TYPE).trim(); name = matcher.group(NAME).trim(); hashCode = computeHashCode(); if (packageName.equals("xmlns")) throw new IllegalStateException("\"" + fullyQualifiedName + "\" unexpected"); }
public ResName(@NotNull String fullyQualifiedName) { Matcher matcher = FQN_PATTERN.matcher(fullyQualifiedName.trim()); if (!matcher.find()) { throw new IllegalStateException("\"" + fullyQualifiedName + "\" is not fully qualified"); } packageName = matcher.group(NAMESPACE); type = matcher.group(TYPE).trim(); String nameStr = matcher.group(NAME); name = nameStr.indexOf('.') != -1 ? nameStr.replace('.', '_') : nameStr; hashCode = computeHashCode(); if (packageName.equals("xmlns")) throw new IllegalStateException("\"" + fullyQualifiedName + "\" unexpected"); }