Java Code Examples for com.sun.org.apache.xml.internal.serializer.SerializationHandler#HTML_ATTRURL

The following examples show how to use com.sun.org.apache.xml.internal.serializer.SerializationHandler#HTML_ATTRURL . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 2
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 3
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 4
Source Project: JDKSourceCode1.8   File: LiteralAttribute.java    License: MIT License 4 votes vote down vote up
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 5
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 6
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 7
Source Project: Bytecoder   File: LiteralAttribute.java    License: Apache License 2.0 4 votes vote down vote up
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 8
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 9
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 10
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}
 
Example 11
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // push handler
    il.append(methodGen.loadHandler());
    // push attribute name - namespace prefix set by parent node
    il.append(new PUSH(cpg, _name));
    // push attribute value
    _value.translate(classGen, methodGen);

    // Generate code that calls SerializationHandler.addUniqueAttribute()
    // if all attributes are unique.
    SyntaxTreeNode parent = getParent();
    if (parent instanceof LiteralElement
        && ((LiteralElement)parent).allAttributesUnique()) {

        int flags = 0;
        boolean isHTMLAttrEmpty = false;
        ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();

        // Set the HTML flags
        if (elemDesc != null) {
            if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
                flags = flags | SerializationHandler.HTML_ATTREMPTY;
                isHTMLAttrEmpty = true;
            }
            else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
                flags = flags | SerializationHandler.HTML_ATTRURL;
            }
        }

        if (_value instanceof SimpleAttributeValue) {
            String attrValue = ((SimpleAttributeValue)_value).toString();

            if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
                flags = flags | SerializationHandler.NO_BAD_CHARS;
            }
        }

        il.append(new PUSH(cpg, flags));
        il.append(methodGen.uniqueAttribute());
    }
    else {
        // call attribute
        il.append(methodGen.attribute());
    }
}