Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlString


   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      final String stringValue = "somethang";
      prop.set( 0,
            XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      XmlString xString = (XmlString) prop.get( 0 );
      assertEquals( stringValue,
            xString.getStringValue() );
   }
View Full Code Here


      while( ( strLine = br.readLine() ) != null )
      {
        value.append( strLine ).append( '\n' );
      }
      in.close();
      XmlString bomb = xmlBombConfig.addNewXmlBombs();
      bomb.setStringValue( value.toString() );
    }
    catch( Exception e )
    {
      SoapUI.logError( e );
    }

    try
    {
      InputStream in = SoapUI.class
          .getResourceAsStream( "/com/eviware/soapui/resources/security/xmlbomb/QuadraticBlowup.xml.txt" );
      BufferedReader br = new BufferedReader( new InputStreamReader( in ) );
      String strLine;
      StringBuffer value = new StringBuffer();
      while( ( strLine = br.readLine() ) != null )
      {
        value.append( strLine ).append( '\n' );
      }
      in.close();
      XmlString bomb = xmlBombConfig.addNewXmlBombs();
      bomb.setStringValue( value.toString() );
    }
    catch( Exception e )
    {
      SoapUI.logError( e );
    }

    try
    {
      InputStream in = SoapUI.class
          .getResourceAsStream( "/com/eviware/soapui/resources/security/xmlbomb/ExternalEntity.dtd.txt" );
      BufferedReader br = new BufferedReader( new InputStreamReader( in ) );
      String strLine;
      StringBuffer value = new StringBuffer();
      while( ( strLine = br.readLine() ) != null )
      {
        value.append( strLine ).append( '\n' );
      }
      in.close();
      XmlString bomb = xmlBombConfig.addNewXmlBombs();
      bomb.setStringValue( value.toString() );
    }
    catch( Exception e )
    {
      SoapUI.logError( e );
    }
View Full Code Here

        // set stack trace if present
        if (trace != null) {
            final StringWriter sw = new StringWriter();
            trace.printStackTrace(new PrintWriter(sw));

            XmlString traceXmlStr = XmlString.Factory.newInstance();
            traceXmlStr.setStringValue(sw.toString());
            activityType.addNewFailure().addNewTrace().set(traceXmlStr);
        }
        sendNotification(wtcontext, activity, descriptionAndAnnotation, "[Service failed]");
    }
View Full Code Here

        // set stack trace if present
        if (trace != null) {
            final StringWriter sw = new StringWriter();
            trace.printStackTrace(new PrintWriter(sw));

            XmlString traceXmlStr = XmlString.Factory.newInstance();
            traceXmlStr.setStringValue(sw.toString());
            activityType.addNewFailure().addNewTrace().set(traceXmlStr);
        }

        sendNotification(wtcontext, activity, descriptionAndAnnotation, "[Unable to send result of invocation]");
    }
View Full Code Here

      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      final String stringValue = "somethang";
      prop.add( XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      assertEquals( 2,
            prop.size() );
      XmlString xString = (XmlString) prop.get( 1 );
      assertEquals( stringValue,
            xString.getStringValue() );
   }
View Full Code Here

   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      final String stringValue = "somethang";
      prop.set( 0,
            XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      XmlString xString = (XmlString) prop.get( 0 );
      assertEquals( stringValue,
            xString.getStringValue() );
   }
View Full Code Here

  public boolean createNode(NodeType newNode, NodeModel model)
  {
    // write properties of this node into graphml file
    DataType xData = newNode.addNewData();
    xData.setKey(xKey.getId());
    XmlString xStr = XmlString.Factory.newValue("" + model.getConstraint().x);
    xData.set(xStr);

    DataType yData = newNode.addNewData();
    yData.setKey(yKey.getId());
    XmlString yStr = XmlString.Factory.newValue("" + model.getConstraint().y);
    yData.set(yStr);

    DataType heightData = newNode.addNewData();
    heightData.setKey(heightKey.getId());
    heightData.set(XmlString.Factory.newValue("" + model.getConstraint().height));

    DataType widthData = newNode.addNewData();
    widthData.setKey(widthKey.getId());
    XmlString widthStr = XmlString.Factory.newValue("" + model.getConstraint().width);
    widthData.set(widthStr);

    DataType colorData = newNode.addNewData();
    colorData.setKey(colorKey.getId());
    RGB rgb = model.getColor().getRGB();
View Full Code Here

             */
            HostDescription globus = new HostDescription(GlobusHostType.type);
            globus.getType().setHostName(hostId2);
            globus.getType().setHostAddress(address);
           
            XmlString point = ((GlobusHostType)globus.getType()).addNewGridFTPEndPoint();
            point.setStringValue("xxxxxxx");          

            jcrRegistry.saveHostDescription(globus);

            HostDescription hg = jcrRegistry.getHostDescription(hostId2);

View Full Code Here

   throws Exception
   {
      final QName stateElemName = new QName( "urn:nsuri", "State" );

      // Demo #1: shows creating an empty xsd:string element and then setting its value later
      XmlString xString =
         (XmlString) XmlBeansUtils.createXmlAnySimpleType( XmlConstants.XSD_STRING, stateElemName );
      XmlBeansUtils.setValue( xString, "Alaska" );
      System.out.println( xString );

      // Demo #2: shows creating an xsd:string element containing a value
View Full Code Here

    private String getFCCID(ResourceStub resource)
            throws FaultException
    {
        XmlObject fccIdPropElem = getSingleProperty(resource, WeatherstationPropertyQNames.FCCID);
        assertTrue("FCCID was not an xs:String", fccIdPropElem instanceof XmlString);
        XmlString fccId = (XmlString) fccIdPropElem;
        return fccId.getStringValue();
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.