com.aspose.words

Class WarningInfo

  • java.lang.Object
    • com.aspose.words.WarningInfo
public class WarningInfo 
extends java.lang.Object

Contains information about a warning that Aspose.Words issued during document loading or saving.

You do not create instances of this class. Objects of this class are created and passed by Aspose.Words to the IWarningCallback.warning(com.aspose.words.WarningInfo) method.

Example:

Shows how to implement the IWarningCallback to be notified of any font substitution during document save.
public static class HandleDocumentWarnings implements IWarningCallback
{
    /**
     *  Our callback only needs to implement the "Warning" method. This method is called whenever there is a
     *  potential issue during document processing. The callback can be set to listen for warnings generated during document
     *  load and/or document save.
     */
    public void warning(WarningInfo info)
    {
        // We are only interested in fonts being substituted.
        if (info.getWarningType() == WarningType.FONT_SUBSTITUTION)
        {
            System.out.println("Font substitution: " + info.getDescription());
        }
    }

}
See Also:
IWarningCallback

Property Getters/Setters Summary
java.lang.StringgetDescription()
Returns the description of the warning.
intgetSource()
Returns the source of the warning. The value of the property is WarningSource integer constant.
intgetWarningType()
Returns the type of the warning. The value of the property is WarningType integer constant.
 

    • Property Getters/Setters Detail

      • getDescription

        public java.lang.String getDescription()
        
        Returns the description of the warning.

        Example:

        Shows how to implement the IWarningCallback to be notified of any font substitution during document save.
        public static class HandleDocumentWarnings implements IWarningCallback
        {
            /**
             *  Our callback only needs to implement the "Warning" method. This method is called whenever there is a
             *  potential issue during document processing. The callback can be set to listen for warnings generated during document
             *  load and/or document save.
             */
            public void warning(WarningInfo info)
            {
                // We are only interested in fonts being substituted.
                if (info.getWarningType() == WarningType.FONT_SUBSTITUTION)
                {
                    System.out.println("Font substitution: " + info.getDescription());
                }
            }
        
        }
      • getSource

        public int getSource()
        
        Returns the source of the warning. The value of the property is WarningSource integer constant.
      • getWarningType

        public int getWarningType()
        
        Returns the type of the warning. The value of the property is WarningType integer constant.

        Example:

        Shows how to implement the IWarningCallback to be notified of any font substitution during document save.
        public static class HandleDocumentWarnings implements IWarningCallback
        {
            /**
             *  Our callback only needs to implement the "Warning" method. This method is called whenever there is a
             *  potential issue during document processing. The callback can be set to listen for warnings generated during document
             *  load and/or document save.
             */
            public void warning(WarningInfo info)
            {
                // We are only interested in fonts being substituted.
                if (info.getWarningType() == WarningType.FONT_SUBSTITUTION)
                {
                    System.out.println("Font substitution: " + info.getDescription());
                }
            }
        
        }