Java Code Examples for com.sun.org.apache.xerces.internal.xs.ElementPSVI#getSchemaNormalizedValue()

The following examples show how to use com.sun.org.apache.xerces.internal.xs.ElementPSVI#getSchemaNormalizedValue() . 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
Source File: PSVIElementNSImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 2
Source File: PSVIElementNSImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 3
Source File: PSVIElementNSImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 4
Source File: PSVIElementNSImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 5
Source File: PSVIElementNSImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 6
Source File: PSVIElementNSImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 7
Source File: PSVIElementNSImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 8
Source File: PSVIElementNSImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 9
Source File: PSVIElementNSImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(ElementPSVI elem) {
    this.fDeclaration = elem.getElementDeclaration();
    this.fNotation = elem.getNotation();
    this.fValidationContext = elem.getValidationContext();
    this.fTypeDecl = elem.getTypeDefinition();
    this.fSchemaInformation = elem.getSchemaInformation();
    this.fValidity = elem.getValidity();
    this.fValidationAttempted = elem.getValidationAttempted();
    this.fErrorCodes = elem.getErrorCodes();
    this.fNormalizedValue = elem.getSchemaNormalizedValue();
    this.fActualValue = elem.getActualNormalizedValue();
    this.fActualValueType = elem.getActualNormalizedValueType();
    this.fItemValueTypes = elem.getItemValueTypes();
    this.fMemberType = elem.getMemberTypeDefinition();
    this.fSpecified = elem.getIsSchemaSpecified();
    this.fNil = elem.getNil();
}
 
Example 10
Source File: DOMNormalizer.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 11
Source File: DOMNormalizer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 12
Source File: DOMNormalizer.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 13
Source File: DOMNormalizer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 14
Source File: DOMNormalizer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 15
Source File: DOMNormalizer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 16
Source File: DOMNormalizer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 17
Source File: DOMNormalizer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 18
Source File: DOMNormalizer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }
 
Example 19
Source File: DOMNormalizer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs    Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void endElement(QName element, Augmentations augs) throws XNIException {
           if (DEBUG_EVENTS) {
                   System.out.println("==>endElement: " + element);
           }

   if(augs != null) {
           ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
           if (elementPSVI != null) {
                   ElementImpl elementNode = (ElementImpl) fCurrentNode;
                   if (fPSVI) {
                           ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
                   }
                   // include element default content (if one is available)
                   String normalizedValue = elementPSVI.getSchemaNormalizedValue();
                   if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
               if (normalizedValue !=null)
                               elementNode.setTextContent(normalizedValue);
                   }
                   else {
                           // NOTE: this is a hack: it is possible that DOM had an empty element
                           // and validator sent default value using characters(), which we don't
                           // implement. Thus, here we attempt to add the default value.
                           String text = elementNode.getTextContent();
                           if (text.length() == 0) {
                                   // default content could be provided
                   if (normalizedValue !=null)
                       elementNode.setTextContent(normalizedValue);
                           }
                   }
           }
   }
   }