Examples of IValue


Examples of com.fineqt.fpb.lib.api.IValue

            IContainerValue msgValue = (IContainerValue)value;
            //取得Content-Length首部字段
            @SuppressWarnings("unchecked")
            IListValue<IRecordSetValue> headers = (IListValue<IRecordSetValue>)
                    msgValue.getField(HTTP_MESSAGE__HEADERS);
            IValue contentLengthValue = null;
            if (headers != null) {
                for (int i = 0; i < headers.getLength(); i++) {
                    IRecordSetValue header = headers.getItem(i);
                    if (header == null) {
                        continue;                           
                    }
                    IValue name = header.getField(HTTP_HEADER__NAME);
                    if (name == null) {
                        continue;
                    }
                    if (HeaderNames.CONTENT_LENGTH.equals(name.getText())) {
                        contentLengthValue = header.getField(HTTP_HEADER__VALUE);
                    }
                }
            }
            //根据httpBody/data来更新
View Full Code Here

Examples of com.fineqt.fpb.lib.api.IValue

        }

        private void updateChunkLength(PValue value) {
            IContainerValue chunkValue = (IContainerValue)value;
            //取得chunkLength字段
            IValue chunkLength = null;
            IContainerValue lengthLine = (IContainerValue)chunkValue.getField(
                    HTTP_CHUNK__LENGTH_LINE);
            if (lengthLine != null) {
                chunkLength = lengthLine.getField(HTTP_CHUNK_LENGTH_LINE__CHUNK_LENGTH);
            }
            //根据chunkData/data来更新
            if (chunkLength != null) {
                IContainerValue chunkData = (IContainerValue)chunkValue.getField(
                        HTTP_CHUNK__CHUNK_DATA);
                //默认为0
                String text = "0";
                if (chunkData != null && !chunkData.notPresent()) {
                    IOctetstringValue data = (IOctetstringValue)chunkData.getField(
                            HTTP_CHUNK_DATA__DATA);
                    if (data != null) {
                        text = Integer.toString(data.getLength());
                    }
                }
                chunkLength.setText(text);
            }
        }
View Full Code Here

Examples of com.fineqt.fpb.lib.api.IValue

                DecodeParameters paras, DecodeResult result) throws DecodeException {
            DecodeResult ret = super.postDecode(cxt, input, paras, result);
            if (ret.getValue() != null) {
                //设置chunkLength
                IContainerValue value = (IContainerValue)ret.getValue();
                IValue lenValue = value.getField(HTTP_CHUNK_LENGTH_LINE__CHUNK_LENGTH);
                IIntegerValue intValue = (IIntegerValue)cxt.getFieldStackMap().peekField(
                        StackFields.CHUNK_LENGTH);
                if (intValue == null) {
                    intValue = getPModule().getFactory().createInteger();
                    cxt.getFieldStackMap().setTopField(StackFields.CHUNK_LENGTH, intValue);
                }
                try {
                    intValue.setInteger(Integer.parseInt(lenValue.getText(), 16));
                } catch (NumberFormatException e) {
                    //有错误时认为是0
                    intValue.setInteger(0);
                }
            }
View Full Code Here

Examples of com.fineqt.fpb.lib.api.IValue

    @Override
    protected boolean postDecodeItem(DecodeContext cxt, IBitBuffer input, DecodeParameters paras,
        DecodeResult parentResult, DecodeResult itemResult, PListItemExt itemMeta) {
      if (itemResult.getValue() != null ) {
        IUnionValue listItem = (IUnionValue)itemResult.getValue();
        IValue variant = listItem.getPresentVariant();
        //遇到LastOption后停止列表余下项目的解码
        if (variant != null && variant.getType().getID() == LAST_OPTION) {
          return false;
        }
      }
      return true;
    }
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.IValue

   * @throws RepositoryException if an unexpected error occurs
   */
  private void getDctmAttribute(String name, int dataType, List<Value> values)
      throws RepositoryException {
    for (int i = 0, n = object.getValueCount(name); i < n; i++) {
      IValue val = object.getRepeatingValue(name, i);
      try {
        switch (dataType) {
          case IAttr.DM_BOOLEAN:
            values.add(Value.getBooleanValue(val.asBoolean()));
            break;
          case IAttr.DM_DOUBLE:
            values.add(Value.getDoubleValue(val.asDouble()));
            break;
          case IAttr.DM_ID:
            // TODO: Should we check for null here?
            values.add(Value.getStringValue(val.asId().getId()));
            break;
          case IAttr.DM_INTEGER:
            values.add(Value.getLongValue(val.asInteger()));
            break;
          case IAttr.DM_STRING:
            values.add(Value.getStringValue(val.asString()));
            break;
          case IAttr.DM_TIME:
            Date date = val.asTime().getDate();
            if (date != null) {
              values.add(Value.getDateValue(getCalendarFromDate(date)));
            }
            break;
          default:
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.IValue

                                    if ( attribute.getDescription().equals( line.getUnfoldedAttributeDescription() ) )
                                    {
                                        IValue[] values = attribute.getValues();
                                        for ( int v = 0; v < values.length; v++ )
                                        {
                                            IValue value = values[v];
                                            if ( value.getStringValue().equals( line.getValueAsString() ) )
                                            {
                                                selectionList.add( value );
                                            }
                                        }
                                    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue

                {
                    StructuredSelection selection = ( StructuredSelection ) context.getSelection();
                    Object obj = selection.getFirstElement();
                    if ( obj instanceof IValue )
                    {
                        IValue value = ( IValue ) obj;
                        IEntry entry = value.getAttribute().getEntry();
                        // The entry may be a clone, lookup original entry from entry cache.
                        // The result may be null, in that case the selection won't change.
                        entry =  entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue

                return false;
            }
        }
        else if ( element instanceof IValue )
        {
            IValue value = ( IValue ) element;

            // check quick filter
            if ( !goesThroughQuickFilter( value ) )
            {
                return false;
            }

            // check attribute category
            if ( !goesThroughtCategoryFilter( value.getAttribute() ) )
            {
                return false;
            }
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue

     */
    public boolean canModify( Object element, String property )
    {
        if ( element != null && element instanceof IValue && valueEditorManager != null )
        {
            IValue attributeValue = ( IValue ) element;

            if ( EntryEditorWidgetTableMetadata.KEY_COLUMN_NAME.equals( property ) )
            {
                return false;
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue

     */
    public Object getValue( Object element, String property )
    {
        if ( element != null && element instanceof IValue && valueEditorManager != null )
        {
            IValue attributeValue = ( IValue ) element;
            Object returnValue;
            if ( EntryEditorWidgetTableMetadata.KEY_COLUMN_NAME.equals( property ) )
            {
                returnValue = attributeValue.getAttribute().getDescription();
            }
            else if ( EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME.equals( property ) )
            {
                returnValue = this.valueEditorManager.getCurrentValueEditor( attributeValue ).getRawValue(
                    attributeValue );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.