当前位置: 首页>>代码示例>>Java>>正文


Java I18n.translate方法代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.security.utils.I18n.translate方法的典型用法代码示例。如果您正苦于以下问题:Java I18n.translate方法的具体用法?Java I18n.translate怎么用?Java I18n.translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xml.internal.security.utils.I18n的用法示例。


在下文中一共展示了I18n.translate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVerificationResult

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * After verifying a {@link Manifest} or a {@link SignedInfo} using the
 * {@link Manifest#verifyReferences()} or {@link SignedInfo#verify()} methods,
 * the individual results can be retrieved with this method.
 *
 * @param index an index of into a {@link Manifest} or a {@link SignedInfo}
 * @return the results of reference validation at the specified index
 * @throws XMLSecurityException
 */
public boolean getVerificationResult(int index) throws XMLSecurityException {
    if ((index < 0) || (index > this.getLength() - 1)) {
        Object exArgs[] = { Integer.toString(index), Integer.toString(this.getLength()) };
        Exception e =
            new IndexOutOfBoundsException(
                I18n.translate("signature.Verification.IndexOutOfBounds", exArgs)
            );

        throw new XMLSecurityException("generic.EmptyMessage", e);
    }

    if (this.verificationResults == null) {
        try {
            this.verifyReferences();
        } catch (Exception ex) {
            throw new XMLSecurityException("generic.EmptyMessage", ex);
        }
    }

    return this.verificationResults[index];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:Manifest.java

示例2: RSAKeyValue

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor RSAKeyValue
 *
 * @param doc
 * @param key
 * @throws IllegalArgumentException
 */
public RSAKeyValue(Document doc, Key key) throws IllegalArgumentException {
    super(doc);

    XMLUtils.addReturnToElement(this.constructionElement);

    if (key instanceof java.security.interfaces.RSAPublicKey ) {
        this.addBigIntegerElement(
            ((RSAPublicKey) key).getModulus(), Constants._TAG_MODULUS
        );
        this.addBigIntegerElement(
            ((RSAPublicKey) key).getPublicExponent(), Constants._TAG_EXPONENT
        );
    } else {
        Object exArgs[] = { Constants._TAG_RSAKEYVALUE, key.getClass().getName() };

        throw new IllegalArgumentException(I18n.translate("KeyValue.IllegalArgument", exArgs));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:RSAKeyValue.java

示例3: DSAKeyValue

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor DSAKeyValue
 *
 * @param doc
 * @param key
 * @throws IllegalArgumentException
 */
public DSAKeyValue(Document doc, Key key) throws IllegalArgumentException {
    super(doc);

    XMLUtils.addReturnToElement(this.constructionElement);

    if (key instanceof java.security.interfaces.DSAPublicKey) {
        this.addBigIntegerElement(((DSAPublicKey) key).getParams().getP(), Constants._TAG_P);
        this.addBigIntegerElement(((DSAPublicKey) key).getParams().getQ(), Constants._TAG_Q);
        this.addBigIntegerElement(((DSAPublicKey) key).getParams().getG(), Constants._TAG_G);
        this.addBigIntegerElement(((DSAPublicKey) key).getY(), Constants._TAG_Y);
    } else {
        Object exArgs[] = { Constants._TAG_DSAKEYVALUE, key.getClass().getName() };

        throw new IllegalArgumentException(I18n.translate("KeyValue.IllegalArgument", exArgs));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:DSAKeyValue.java

示例4: getVerificationResult

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * After verifying a {@link Manifest} or a {@link SignedInfo} using the
 * {@link Manifest#verifyReferences()} or {@link SignedInfo#verify()} methods,
 * the individual results can be retrieved with this method.
 *
 * @param index an index of into a {@link Manifest} or a {@link SignedInfo}
 * @return the results of reference validation at the specified index
 * @throws XMLSecurityException
 */
public boolean getVerificationResult(int index) throws XMLSecurityException {

   if ((index < 0) || (index > this.getLength() - 1)) {
      Object exArgs[] = { Integer.toString(index),
                          Integer.toString(this.getLength()) };
      Exception e =
         new IndexOutOfBoundsException(I18n
            .translate("signature.Verification.IndexOutOfBounds", exArgs));

      throw new XMLSecurityException("generic.EmptyMessage", e);
   }

   if (this.verificationResults == null) {
      try {
         this.verifyReferences();
      } catch (Exception ex) {
         throw new XMLSecurityException("generic.EmptyMessage", ex);
      }
   }

   return this.verificationResults[index];
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:32,代码来源:Manifest.java

示例5: RSAKeyValue

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor RSAKeyValue
 *
 * @param doc
 * @param key
 * @throws IllegalArgumentException
 */
public RSAKeyValue(Document doc, Key key) throws IllegalArgumentException {

   super(doc);

   XMLUtils.addReturnToElement(this._constructionElement);

   if (key instanceof java.security.interfaces.RSAPublicKey ) {
      this.addBigIntegerElement(((RSAPublicKey) key).getModulus(),
                                Constants._TAG_MODULUS);
      this.addBigIntegerElement(((RSAPublicKey) key).getPublicExponent(),
                                Constants._TAG_EXPONENT);
   } else {
      Object exArgs[] = { Constants._TAG_RSAKEYVALUE,
                          key.getClass().getName() };

      throw new IllegalArgumentException(I18n
         .translate("KeyValue.IllegalArgument", exArgs));
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:27,代码来源:RSAKeyValue.java

示例6: DSAKeyValue

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor DSAKeyValue
 *
 * @param doc
 * @param key
 * @throws IllegalArgumentException
 */
public DSAKeyValue(Document doc, Key key) throws IllegalArgumentException {

   super(doc);

   XMLUtils.addReturnToElement(this._constructionElement);

   if (key instanceof java.security.interfaces.DSAPublicKey) {
      this.addBigIntegerElement(((DSAPublicKey) key).getParams().getP(),
                                Constants._TAG_P);
      this.addBigIntegerElement(((DSAPublicKey) key).getParams().getQ(),
                                Constants._TAG_Q);
      this.addBigIntegerElement(((DSAPublicKey) key).getParams().getG(),
                                Constants._TAG_G);
      this.addBigIntegerElement(((DSAPublicKey) key).getY(),
                                Constants._TAG_Y);
   } else {
      Object exArgs[] = { Constants._TAG_DSAKEYVALUE,
                          key.getClass().getName() };

      throw new IllegalArgumentException(I18n
         .translate("KeyValue.IllegalArgument", exArgs));
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:31,代码来源:DSAKeyValue.java

示例7: FuncHereContext

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor FuncHereContext
 *
 * @param owner
 * @param xpathContext
 */
public FuncHereContext(Node owner, XPathContext xpathContext) {

   super(owner);

   try {
      super.m_dtmManager = xpathContext.getDTMManager();
   } catch (IllegalAccessError iae) {
      throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                   + " Original message was \""
                                   + iae.getMessage() + "\"");
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:19,代码来源:FuncHereContext.java

示例8: Manifest

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor Manifest
 *
 * @param element
 * @param BaseURI
 * @throws XMLSecurityException
 */
public Manifest(Element element, String BaseURI)
        throws XMLSecurityException {

   super(element, BaseURI);

   // check out Reference children
   this._referencesEl = XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(),
      Constants._TAG_REFERENCE);
   int le = this._referencesEl.length;
   {
      if (le == 0) {

         // At least one Reference must be present. Bad.
         Object exArgs[] = { Constants._TAG_REFERENCE,
                             Constants._TAG_MANIFEST };

         throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                I18n.translate("xml.WrongContent", exArgs));
      }
   }

   // create Vector
   this._references = new ArrayList(le);

   for (int i = 0; i < le; i++) {
      this._references.add(null);
   }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:36,代码来源:Manifest.java

示例9: FuncHereContext

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor FuncHereContext
 *
 * @param owner
 * @param dtmManager
 */
public FuncHereContext(Node owner, DTMManager dtmManager) {

   super(owner);

   try {
      super.m_dtmManager = dtmManager;
   } catch (IllegalAccessError iae) {
      throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                   + " Original message was \""
                                   + iae.getMessage() + "\"");
   }
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:19,代码来源:FuncHereContext.java

示例10: FuncHereContext

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor FuncHereContext
 *
 * @param owner
 * @param previouslyUsed
 */
public FuncHereContext(Node owner, CachedXPathAPI previouslyUsed) {

   super(owner);

   try {
      super.m_dtmManager = previouslyUsed.getXPathContext().getDTMManager();
   } catch (IllegalAccessError iae) {
      throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                   + " Original message was \""
                                   + iae.getMessage() + "\"");
   }
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:19,代码来源:FuncHereContext.java

示例11: Manifest

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * Constructor Manifest
 *
 * @param element
 * @param BaseURI
 * @throws XMLSecurityException
 */
public Manifest(Element element, String BaseURI)
        throws XMLSecurityException {

   super(element, BaseURI);

   Attr attr = element.getAttributeNodeNS(null, "Id");
   if (attr != null) {
       element.setIdAttributeNode(attr, true);
   }

   // check out Reference children
   this._referencesEl = XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(),
      Constants._TAG_REFERENCE);
   int le = this._referencesEl.length;
   {
      if (le == 0) {

         // At least one Reference must be present. Bad.
         Object exArgs[] = { Constants._TAG_REFERENCE,
                             Constants._TAG_MANIFEST };

         throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                I18n.translate("xml.WrongContent", exArgs));
      }
   }

   // create Vector
   this._references = new ArrayList(le);

   for (int i = 0; i < le; i++) {
      Element refElem = this._referencesEl[i];
      Attr refAttr = refElem.getAttributeNodeNS(null, "Id");
      if (refAttr != null) {
          refElem.setIdAttributeNode(refAttr, true);
      }
      this._references.add(null);
   }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:46,代码来源:Manifest.java

示例12: execute

import com.sun.org.apache.xml.internal.security.utils.I18n; //导入方法依赖的package包/类
/**
 * The here function returns a node-set containing the attribute or
 * processing instruction node or the parent element of the text node
 * that directly bears the XPath expression.  This expression results
 * in an error if the containing XPath expression does not appear in the
 * same XML document against which the XPath expression is being evaluated.
 *
 * @param xctxt
 * @return the xobject
 * @throws javax.xml.transform.TransformerException
 */
@Override
public XObject execute(XPathContext xctxt)
    throws javax.xml.transform.TransformerException {

    Node xpathOwnerNode = (Node) xctxt.getOwnerObject();

    if (xpathOwnerNode == null) {
        return null;
    }

    int xpathOwnerNodeDTM = xctxt.getDTMHandleFromNode(xpathOwnerNode);

    int currentNode = xctxt.getCurrentNode();
    DTM dtm = xctxt.getDTM(currentNode);
    int docContext = dtm.getDocument();

    if (DTM.NULL == docContext) {
        error(xctxt, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC, null);
    }

    {
        // check whether currentNode and the node containing the XPath expression
        // are in the same document
        Document currentDoc =
            XMLUtils.getOwnerDocument(dtm.getNode(currentNode));
        Document xpathOwnerDoc = XMLUtils.getOwnerDocument(xpathOwnerNode);

        if (currentDoc != xpathOwnerDoc) {
            throw new TransformerException(I18n.translate("xpath.funcHere.documentsDiffer"));
        }
    }

    XNodeSet nodes = new XNodeSet(xctxt.getDTMManager());
    NodeSetDTM nodeSet = nodes.mutableNodeset();

    {
        int hereNode = DTM.NULL;

        switch (dtm.getNodeType(xpathOwnerNodeDTM)) {

        case Node.ATTRIBUTE_NODE :
        case Node.PROCESSING_INSTRUCTION_NODE : {
            // returns a node-set containing the attribute /  processing instruction node
            hereNode = xpathOwnerNodeDTM;

            nodeSet.addNode(hereNode);

            break;
        }
        case Node.TEXT_NODE : {
            // returns a node-set containing the parent element of the
            // text node that directly bears the XPath expression
            hereNode = dtm.getParent(xpathOwnerNodeDTM);

            nodeSet.addNode(hereNode);

            break;
        }
        default :
            break;
        }
    }

    /** $todo$ Do I have to do this detach() call? */
    nodeSet.detach();

    return nodes;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:80,代码来源:FuncHere.java


注:本文中的com.sun.org.apache.xml.internal.security.utils.I18n.translate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。