/** * Computes the "complete attribute wildcard" */ private AttributeWildcard calcCompleteWildcard( AttributeWildcard local, Set<AttributeWildcard> s ) { final AttributeWildcard[] children = (AttributeWildcard[])s.toArray(new AttributeWildcard[s.size()]); // 1st step is to compute the complete wildcard. if( children.length==0 ) return local; // assert(children.length>0) // compute the intersection of wildcard. NameClass target = children[0].getName(); for( int i=1; i<children.length; i++ ) target = NameClass.intersection(target,children[i].getName()); if( local!=null ) return new AttributeWildcard( NameClass.intersection(local.getName(),target), local.getProcessMode() ); else return new AttributeWildcard( target, children[0].getProcessMode() ); }
/** * Computes the "complete attribute wildcard" */ private AttributeWildcard calcCompleteWildcard( AttributeWildcard local, Set s ) { final AttributeWildcard[] children = (AttributeWildcard[])s.toArray(new AttributeWildcard[s.size()]); // 1st step is to compute the complete wildcard. if( children.length==0 ) return local; // assert(children.length>0) // compute the intersection of wildcard. NameClass target = children[0].getName(); for( int i=1; i<children.length; i++ ) target = NameClass.intersection(target,children[i].getName()); if( local!=null ) return new AttributeWildcard( NameClass.intersection(local.getName(),target), local.getProcessMode() ); else return new AttributeWildcard( target, children[0].getProcessMode() ); }
/** * Computes the "complete attribute wildcard" */ private AttributeWildcard calcCompleteWildcard( AttributeWildcard local, Set s ) { final AttributeWildcard[] children = (AttributeWildcard[])s.toArray(new AttributeWildcard[s.size()]); // 1st step is to compute the complete wildcard. if( children.length==0 ) return local; // assert(children.length>0) // compute the intersection of wildcard. NameClass target = children[0].getName(); for( int i=1; i<children.length; i++ ) target = NameClass.intersection(target,children[i].getName()); if( local!=null ) return new AttributeWildcard( NameClass.intersection(local.getName(),target), local.getProcessMode() ); else return new AttributeWildcard( target, children[0].getProcessMode() ); }
/** * Computes the "complete attribute wildcard" */ private AttributeWildcard calcCompleteWildcard( AttributeWildcard local, Set s ) { final AttributeWildcard[] children = (AttributeWildcard[])s.toArray(new AttributeWildcard[s.size()]); // 1st step is to compute the complete wildcard. if( children.length==0 ) return local; // assert(children.length>0) // compute the intersection of wildcard. NameClass target = children[0].getName(); for( int i=1; i<children.length; i++ ) target = NameClass.intersection(target,children[i].getName()); if( local!=null ) return new AttributeWildcard( NameClass.intersection(local.getName(),target), local.getProcessMode() ); else return new AttributeWildcard( target, children[0].getProcessMode() ); }
/** Tests two name classes to see if they collide. */ protected void check( NameClassAndExpression newExp, NameClassAndExpression oldExp ) { if(checker.check( newExp.getNameClass(), oldExp.getNameClass() )) { // two attributes/elements collide NameClass intersection = NameClass.intersection( newExp.getNameClass(), oldExp.getNameClass() ); reader.reportError( new Locator[]{ reader.getDeclaredLocationOf(errorContext), // the parent element reader.getDeclaredLocationOf(newExp), reader.getDeclaredLocationOf(oldExp)}, getErrorMessage(), new Object[]{intersection.toString()} ); } }
/** Tests two name classes to see if they collide. */ protected void check( NameClassAndExpression newExp, NameClassAndExpression oldExp ) { if(checker.check( newExp.getNameClass(), oldExp.getNameClass() )) { // two attributes/elements collide NameClass intersection = NameClass.intersection( newExp.getNameClass(), oldExp.getNameClass() ); reader.reportError( new Locator[]{ reader.getDeclaredLocationOf(errorContext), // the parent element reader.getDeclaredLocationOf(newExp), reader.getDeclaredLocationOf(oldExp)}, getErrorMessage(), new Object[]{intersection.toString()} ); } }
/** Tests two name classes to see if they collide. */ protected void check( NameClassAndExpression newExp, NameClassAndExpression oldExp ) { if(checker.check( newExp.getNameClass(), oldExp.getNameClass() )) { // two attributes/elements collide NameClass intersection = NameClass.intersection( newExp.getNameClass(), oldExp.getNameClass() ); reader.reportError( new Locator[]{ reader.getDeclaredLocationOf(errorContext), // the parent element reader.getDeclaredLocationOf(newExp), reader.getDeclaredLocationOf(oldExp)}, getErrorMessage(), new Object[]{intersection.toString()} ); } }
/** Tests two name classes to see if they collide. */ protected void check( NameClassAndExpression newExp, NameClassAndExpression oldExp ) { if(checker.check( newExp.getNameClass(), oldExp.getNameClass() )) { // two attributes/elements collide NameClass intersection = NameClass.intersection( newExp.getNameClass(), oldExp.getNameClass() ); reader.reportError( new Locator[]{ reader.getDeclaredLocationOf(errorContext), // the parent element reader.getDeclaredLocationOf(newExp), reader.getDeclaredLocationOf(oldExp)}, getErrorMessage(), new Object[]{intersection.toString()} ); } }