import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSet.Builder;
import com.google.common.collect.Iterables;
import java.util.Collection;
import java.util.Date;
.isAssignableFrom(stmtCtx.getPublicDefinition().getDeclaredRepresentationClass());
}
- public static Collection<SchemaNodeIdentifier> replaceModuleQNameForKey(
- final StmtContext<Collection<SchemaNodeIdentifier>, KeyStatement, ?> keyStmtCtx,
- final QNameModule newQNameModule) {
-
- final Builder<SchemaNodeIdentifier> builder = ImmutableSet.builder();
- boolean replaced = false;
- for (final SchemaNodeIdentifier arg : keyStmtCtx.getStatementArgument()) {
- final QName qname = arg.getLastComponent();
- if (!newQNameModule.equals(qname)) {
- final QName newQname = keyStmtCtx.getFromNamespace(QNameCacheNamespace.class,
- QName.create(newQNameModule, qname.getLocalName()));
- builder.add(SchemaNodeIdentifier.create(false, newQname));
- replaced = true;
- } else {
- builder.add(arg);
- }
- }
-
- // This makes sure we reuse the collection when a grouping is
- // instantiated in the same module
- return replaced ? builder.build() : keyStmtCtx.getStatementArgument();
- }
-
public static boolean checkFeatureSupport(final StmtContext<?, ?, ?> stmtContext,
final Set<QName> supportedFeatures) {
boolean isSupported = false;