FileDocCategorySizeDatePackage
XPointerFramework.javaAPI DocJava SE 5 API7381Fri Aug 26 14:55:56 BST 2005com.sun.org.apache.xerces.internal.xinclude

XPointerFramework

public class XPointerFramework extends Object

Fields Summary
com.sun.org.apache.xerces.internal.xinclude.XPointerSchema[]
fXPointerSchema
String[]
fSchemaPointerName
String[]
fSchemaPointerURI
String
fSchemaPointer
String
fCurrentSchemaPointer
Stack
fSchemaNotAvailable
int
fCountSchemaName
int
schemaLength
com.sun.org.apache.xerces.internal.xinclude.XPointerSchema
fDefaultXPointerSchema
Constructors Summary
public XPointerFramework()

    
     
        this(null);
    
public XPointerFramework(com.sun.org.apache.xerces.internal.xinclude.XPointerSchema[] xpointerschema)

        fXPointerSchema = xpointerschema;
        fSchemaNotAvailable = new Stack();
    
Methods Summary
public intgetCurrentPointer()

        return fCountSchemaName;
    
public com.sun.org.apache.xerces.internal.xinclude.XPointerSchemagetDefaultSchema()

        if(fDefaultXPointerSchema == null)
            fDefaultXPointerSchema = new XPointerElementHandler();
        return fDefaultXPointerSchema;
    
public java.lang.StringgetEscapedURI(java.lang.String URI)

        return URI;
    
public com.sun.org.apache.xerces.internal.xinclude.XPointerSchemagetNextXPointerSchema()

        int  i=fCountSchemaName;
        if(fSchemaPointerName == null){
            getSchemaNames();
        }
        if(fDefaultXPointerSchema == null){
            getDefaultSchema();
        }
        if(fDefaultXPointerSchema.getXpointerSchemaName().equalsIgnoreCase(fSchemaPointerName[i])){
            fDefaultXPointerSchema.reset();
            fDefaultXPointerSchema.setXPointerSchemaPointer(fSchemaPointerURI[i]);
            fCountSchemaName = ++i;
            return  getDefaultSchema();
        }
        if(fXPointerSchema == null){
            fCountSchemaName = ++i;
            return null;
        }
        
        int fschemalength = fXPointerSchema.length;
        
        for(;fSchemaPointerName[i] != null; i++){
            for(int j=0; j<fschemalength; j++ ){
                if(fSchemaPointerName[i].equalsIgnoreCase(fXPointerSchema[j].getXpointerSchemaName())){
                    fXPointerSchema[j].setXPointerSchemaPointer(fSchemaPointerURI[i]);
                    fCountSchemaName = ++i;
                    return fXPointerSchema[j];
                }
            }
            
            if(fSchemaNotAvailable == null);
            fSchemaNotAvailable = new Stack();
            
            fSchemaNotAvailable.push(fSchemaPointerName[i]);
        }
        return null;
    
public intgetSchemaCount()

        return schemaLength;
    
public voidgetSchemaNames()

        int count =0;
        int index =0, lastindex =0;
        int schemapointerindex  =0, schemapointerURIindex=0;
        char c;
        int length = fSchemaPointer.length();
        fSchemaPointerName = new String [5];
        fSchemaPointerURI = new String [5];
        
        index = fSchemaPointer.indexOf('(");
        if( index <= 0)
            return;
        
        fSchemaPointerName[schemapointerindex++] = fSchemaPointer.substring(0, index++).trim();
        lastindex = index;
        String tempURI = null;
        count++;
        
        while(index < length){
            c = fSchemaPointer.charAt(index);
            if(c == '(")
                count++;
            if(c == ')")
                count--;
            if(count==0 ){
                tempURI = fSchemaPointer.substring(lastindex, index).trim();
                fSchemaPointerURI[schemapointerURIindex++] = getEscapedURI(tempURI);
                lastindex = index;
                if((index = fSchemaPointer.indexOf('(", lastindex)) != -1){
                    fSchemaPointerName[schemapointerindex++] = fSchemaPointer.substring(lastindex+1, index).trim();
                    count++;
                    lastindex = index+1;
                }
                else{
                    index = lastindex;
                }
            }
            index++;
        }
        schemaLength = schemapointerURIindex -1;
    
public voidreset()

        fXPointerSchema = null;
        fXPointerSchema = null;
        fCountSchemaName = 0;
        schemaLength = 0;
        fSchemaPointerName = null;
        fSchemaPointerURI = null;
        fDefaultXPointerSchema = null;
        fCurrentSchemaPointer = null;
    
public voidsetSchemaPointer(java.lang.String schemaPointer)

        fSchemaPointer = schemaPointer;
    
public voidsetXPointerSchema(com.sun.org.apache.xerces.internal.xinclude.XPointerSchema[] xpointerschema)

        fXPointerSchema = xpointerschema;