Writes a component to the data stream.
@param component the component to write
@param parent the parent component
@throws IOException if there's a problem writing to the data stream
977961
@SuppressWarnings({ "rawtypes", "unchecked" })
	private void writeComponent(ICalComponent component, ICalComponent parent) throws IOException {
		boolean inICalendar = component instanceof ICalendar;
		boolean inVCalRoot = inICalendar && getTargetVersion() == ICalVersion.V1_0;
		boolean inICalRoot = inICalendar && getTargetVersion() != ICalVersion.V1_0;

		ICalComponentScribe componentScribe = index.getComponentScribe(component);
		try {
			componentScribe.checkForDataModelConversions(component, parent, getTargetVersion());
		} catch (DataModelConversionException e) {
			for (ICalComponent c : e.getComponents()) {
				writeComponent(c, parent);
			}
			for (ICalProperty p : e.getProperties()) {
				writeProperty(p);
			}
			return;
		}

		writer.writeBeginComponent(componentScribe.getComponentName());

		List propertyObjs = componentScribe.getProperties(component);
		if (inICalendar && component.getProperty(Version.class) == null) {
			propertyObjs.add(0, new Version(getTargetVersion()));
		}

		for (Object propertyObj : propertyObjs) {
			context.setParent(component); //set parent here incase a scribe resets the parent
			ICalProperty property = (ICalProperty) propertyObj;
			writeProperty(property);
		}

		List subComponents = componentScribe.getComponents(component);
		if (inICalRoot) {
			//add the VTIMEZONE components
			Collection<VTimezone> timezones = getTimezoneComponents();
			for (VTimezone timezone : timezones) {
				if (!subComponents.contains(timezone)) {
					subComponents.add(0, timezone);
				}
			}
		}

		for (Object subComponentObj : subComponents) {
			ICalComponent subComponent = (ICalComponent) subComponentObj;
			writeComponent(subComponent, component);
		}

		if (inVCalRoot) {
			Collection<VTimezone> timezones = getTimezoneComponents();
			if (!timezones.isEmpty()) {
				VTimezone timezone = timezones.iterator().next();
				VCalTimezoneProperties props = convert(timezone, context.getDates());

				Timezone tz = props.getTz();
				if (tz != null) {
					writeProperty(tz);
				}
				for (Daylight daylight : props.getDaylights()) {
					writeProperty(daylight);
				}
			}
		}

		writer.writeEndComponent(componentScribe.getComponentName());
	}
317392
public void addChildComponent(final WicketField<?> parent)
	{
		if ((parent.getChildren() != null) && !parent.getChildren().isEmpty())
		{
			for (final SimpleTag iterable_element : parent.getChildren())
			{
				final WicketField<?> field = (WicketField<?>)iterable_element;
				final Component c = parent.getComponent();
				if (c instanceof MarkupContainer)
				{
					final MarkupContainer mc = (MarkupContainer)c;
					mc.add(field.getComponent());
				}
				addChildComponent(field);
			}
		}
	}
1004989
private static void writeStream(final InputStream input, final FileWriter writer)
            throws IOException
    {
        writeStream(input, writer, LineEndingStyle.LOCAL);
    }
526139
public void registerComponent(BaseUIComponent component) {
        if (registeredComponents == null) {
            registeredComponents = new ArrayList<>();
        }

        registeredComponents.add(component);
        component.setAttribute(Constants.ATTR_CONTAINER, this);
        component.setAttribute(Constants.ATTR_VISIBLE, component.isVisible());
        component.setVisible(isVisible());
    }
792962
@Override
    public void writeText(Object text, UIComponent component, String property)
            throws IOException {
        getWrapped().writeText(text, component, property);
    }
374677
function(node, component){
		node.component = component;
		component.nodes.push(node);
		this.setComponentInfo(component);
	}
1280798
protected <T extends IComponent> void addComponent(Class<T> componentType, T component) {
        components.put(componentType, component);
    }
1142104
public void putComponent(String serviceClass,
      String serviceName,
      String componentName,
      ServiceRecord record) throws IOException {
    String path = RegistryUtils.componentPath(
        user, serviceClass, serviceName, componentName);
    registryOperations.mknode(RegistryPathUtils.parentOf(path), true);
    registryOperations.bind(path, record, BindFlags.OVERWRITE);
  }
1010652
public void write(ByteBuffer buffer) throws IOException {
		synchronized (buffers) {
			if (writing == null) {
				writing = io.writeAsync(buffer);
				writing.listenInline(listener);
				return;
			}
			if (writing.hasError()) throw writing.getError();
			buffers.add(buffer);
		}
	}
252154
protected void write(JsonWriter out, T value, TypeAdapter<JsonElement> elementAdapter, TypeAdapter<T> delegate) throws IOException {
        JsonElement tree = delegate.toJsonTree(value);
        beforeWrite(value, tree);
        elementAdapter.write(out, tree);
    }
91530
protected void onAfterRender(final Component component) {
		final Response response = component.getResponse();
		response.write(onWriteAfterRender());
	}
1317334
@SuppressWarnings("unchecked")
    public void writeTo(Object object, TreePruner pruner, DataWriter writer) throws IOException {
        TreePruner child = pruner.accept(object, this);
        if (child==null)        return;

        Object d = writer.getExportConfig().getExportInterceptor().getValue(this,object, writer.getExportConfig());

        if ((d==null && skipNull) || d == ExportInterceptor.SKIP) { // don't write anything
            return;
        }
        if (merge) {
            // merged property will get all its properties written here
            if (d != null) {
                Class<?> objectType = d.getClass();
                Model model = owner.getOrNull(objectType, parent.type, name);
                if (model == null && !writer.getExportConfig().isSkipIfFail()) {
                    throw new NotExportableException(objectType);
                } else if (model != null) {
                    model.writeNestedObjectTo(d, new FilteringTreePruner(parent.HAS_PROPERTY_NAME_IN_ANCESTRY,child), writer);
                }
            }
        } else {
            writer.name(name);
            writeValue(type, d, child, writer);
        }
    }
769518
@Override
    public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus out) throws IOException
    {
        ValidationMetadata validation = (ValidationMetadata) components.get(MetadataType.VALIDATION);
        StatsMetadata stats = (StatsMetadata) components.get(MetadataType.STATS);
        CompactionMetadata compaction = (CompactionMetadata) components.get(MetadataType.COMPACTION);

        assert validation != null && stats != null && compaction != null && validation.partitioner != null;

        EstimatedHistogram.serializer.serialize(stats.estimatedRowSize, out);
        EstimatedHistogram.serializer.serialize(stats.estimatedColumnCount, out);
        ReplayPosition.serializer.serialize(stats.replayPosition, out);
        out.writeLong(stats.minTimestamp);
        out.writeLong(stats.maxTimestamp);
        out.writeInt(stats.maxLocalDeletionTime);
        out.writeDouble(validation.bloomFilterFPChance);
        out.writeDouble(stats.compressionRatio);
        out.writeUTF(validation.partitioner);
        out.writeInt(compaction.ancestors.size());
        for (Integer g : compaction.ancestors)
            out.writeInt(g);
        StreamingHistogram.serializer.serialize(stats.estimatedTombstoneDropTime, out);
        out.writeInt(stats.sstableLevel);
        out.writeInt(stats.minColumnNames.size());
        for (ByteBuffer columnName : stats.minColumnNames)
            ByteBufferUtil.writeWithShortLength(columnName, out);
        out.writeInt(stats.maxColumnNames.size());
        for (ByteBuffer columnName : stats.maxColumnNames)
            ByteBufferUtil.writeWithShortLength(columnName, out);
    }
472785
protected void addComponent(Object o)
    {
        if (!LazyList.contains(_components,o))
        {
            _components = LazyList.add(_components,o);
            if(log.isDebugEnabled())log.debug("add component: "+o);
            ComponentEvent event = new ComponentEvent(this,o);
            for(int i=0;i<LazyList.size(_eventListeners);i++)
            {
                EventListener listener=(EventListener)LazyList.get(_eventListeners,i);
                if (listener instanceof ComponentListener)
                    ((ComponentListener)listener).addComponent(event);
            }
        }
    }
1130780
public void write(ObjectWriter out, PersistedNodeData nodeData) throws IOException
   {
      // write id
      out.writeInt(SerializationConstants.PERSISTED_NODE_DATA);

      // TransientItemData
      out.writeString(nodeData.getQPath().getAsString());
      out.writeString(nodeData.getIdentifier());

      if (nodeData.getParentIdentifier() != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeString(nodeData.getParentIdentifier());
      }
      else
         out.writeByte(SerializationConstants.NULL_DATA);

      out.writeInt(nodeData.getPersistedVersion());
      // -------------------

      out.writeInt(nodeData.getOrderNumber());

      // primary type
      out.writeString(nodeData.getPrimaryTypeName().getAsString());

      // mixins
      InternalQName[] mixinNames = nodeData.getMixinTypeNames();

      if (mixinNames != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeInt(mixinNames.length);
         for (int i = 0; i < mixinNames.length; i++)
         {
            out.writeString(mixinNames[i].getAsString());
         }
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }

      ACLWriter wr = new ACLWriter();

      AccessControlList acl = nodeData.getACL();
      if (acl != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         wr.write(out, acl);
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }
   }
1283699
@Override
    protected void processComponent(final Object component) {
        injectFields(component);
        if (component instanceof Initiated) {
            try {
                ((Initiated) component).initiate();
            } catch (final Exception exception) {
                throw new RuntimeException("Unable to initiate component: " + component, exception);
            }
        }
        if (component instanceof Destructible) {
            destructibles.add((Destructible) component);
        }
    }
1154504
public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException
    {
        RendererUtils.checkParamValidity(facesContext, component, UIData.class);

        beforeBody(facesContext, (UIData) component);

        encodeInnerHtml(facesContext, component);

        afterBody(facesContext, (UIData) component);
    }