Gets the properties to marshal. Child classes can override this for
better control over which properties are marshalled.
@param component the component
@return the properties to marshal
171737
public List<ICalProperty> getProperties(T component) {
		return new ArrayList<ICalProperty>(component.getProperties().values());
	}
1263796
@SuppressWarnings("unchecked")
    public final <C extends T> PropertyList<C> getProperties(final String name) {
        final PropertyList<C> list = new PropertyList<C>();
        for (final T p : this) {
            if (p.getName().equalsIgnoreCase(name)) {
                list.add((C) p);
            }
        }
        return list;
    }
1045428
protected function marshall(QtiComponent $component)
    {
        $element = $this->createElement($component);
        $this->fillElement($element, $component);
        $this->setDOMElementAttribute($element, 'responseIdentifier', $component->getResponseIdentifier());

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->getXmlBase());
        }

        if ($component->hasPrompt() === true) {
            $element->appendChild($this->getMarshallerFactory()->createMarshaller($component->getPrompt())->marshall($component->getPrompt()));
        }

        $element->appendChild($this->getMarshallerFactory()->createMarshaller($component->getObject())->marshall($component->getObject()));

        return $element;
    }
712742
protected static MessageContainer getMessageContainer(final WComponent component) {
		for (WComponent c = component; c != null; c = c.getParent()) {
			if (c instanceof MessageContainer) {
				return (MessageContainer) c;
			}
		}

		return null;
	}
525642
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement($component->getQtiClassName());

        foreach ($component->getContent() as $tr) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($tr);
            $element->appendChild($marshaller->marshall($tr));
        }

        $this->fillElement($element, $component);

        return $element;
    }
1320315
public String getObject(Component component) {
		if(objectModel!=null)
		{
			T object = objectModel.getObject();
			if(object==null) return null;
			resourceKey = getResourceKey(object);
		}
		String defaultValue = getDefault();
		if(defaultValue==null) defaultValue = Strings.lastPathComponent(resourceKey, '.');
		if(defaultValue!=null) defaultValue = buitify(defaultValue);
		return Application.get()
				.getResourceSettings()
				.getLocalizer()
				.getString(resourceKey, null, defaultValue);
	}
1292035
protected function marshall(QtiComponent $component)
    {
        $element = $this->createElement($component);

        $arrayViews = array();
        foreach ($component->getViews() as $view) {
            $key = array_search($view, View::asArray());
            // replace '_' by the space char.
            $arrayViews[] = strtolower(str_replace("\xf2", "\x20", $key));
        }

        if (count($arrayViews) > 0) {
            $this->setDOMElementAttribute($element, 'view', implode("\x20", $arrayViews));
        }

        if ($component->getUse() != '') {
            $this->setDOMElementAttribute($element, 'use', $component->getUse());
        }

        if ($component->hasXmlBase() === true) {
            static::setXmlBase($element, $component->getXmlBase());
        }

        foreach ($component->getContent() as $block) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($block);
            $element->appendChild($marshaller->marshall($block));
        }

        foreach ($component->getStylesheets() as $stylesheet) {
            $stylesheetMarshaller = $this->getMarshallerFactory()->createMarshaller($stylesheet);
            $element->appendChild($stylesheetMarshaller->marshall($stylesheet));
        }

        $this->fillElement($element, $component);

        return $element;
    }
1248036
private static Map decodeComponent(String component) {
        byte[] bodyData = Base64.decode(component, Base64.DEFAULT);
        if (bodyData == null)
            return null;
        try {
            return Manager.getObjectMapper().readValue(bodyData, Map.class);
        } catch (IOException e) {
            Log.w(TAG, "Failed decode component: %s", e, component);
            return null;
        }
    }
470613
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasLowerBound() === true) {
            $this->setDOMElementAttribute($element, 'lowerBound', $component->getLowerBound());
        }

        if ($component->hasUpperBound() === true) {
            $this->setDOMElementAttribute($element, 'upperBound', $component->getUpperBound());
        }

        $this->setDOMElementAttribute($element, 'defaultValue', $component->getDefaultValue());

        foreach ($component->getMapEntries() as $mapEntry) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntry, array($this->getBaseType()));
            $element->appendChild($marshaller->marshall($mapEntry));
        }

        return $element;
    }
667796
public int[] toComponents()
  {
    int[] ver = new int[_components.length];
    
    // Note an array copy is required in order to ensure that this class is immutable.
    System.arraycopy(_components, 0, ver, 0, _components.length);
    
    return ver;
  }
1112838
@Override
	public PropertyDescriptor[] getPropertyDescriptors() {

		List<PropertyDescriptor> proplist = new ArrayList<>();

		try {
			proplist.add(new PropertyDescriptor("type", ELJavascriptBundleTag.class, null, "setTypeExpr"));
		} catch (IntrospectionException ex) {
		}
		try {
			proplist.add(new PropertyDescriptor("async", ELJavascriptBundleTag.class, null, "setAsync"));
		} catch (IntrospectionException ex) {
		}
		try {
			proplist.add(new PropertyDescriptor("defer", ELJavascriptBundleTag.class, null, "setDefer"));
		} catch (IntrospectionException ex) {
		}
		try {
			proplist.add(new PropertyDescriptor("src", ELJavascriptBundleTag.class, null, "setSrcExpr"));
		} catch (IntrospectionException ex) {
		}
		try {
			proplist.add(new PropertyDescriptor("useRandomParam", ELJavascriptBundleTag.class, null,
					"setUseRandomParamExpr"));
		} catch (IntrospectionException ex) {
		}

		PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
		return ((PropertyDescriptor[]) proplist.toArray(result));
	}
1283953
protected String buildTitle(final Component component) {
		Component current = component;
		final StringBuilder title = new StringBuilder();
		while (current != null) {
			final String currentTitle = getTitleIfKnownComponent(current);
			if (currentTitle != null && currentTitle.length() != 0) {
				if (title.length() != 0) {
					title.insert(0, " - ");
				}
				title.insert(0, currentTitle);
			}
			current = current.getParent();
		}

		return title.length() != 0 ? title.toString() : null;
	}
1136048
private static PropertyDescriptor[][] getBeanProperties(Class<?> beanType) {
        List<PropertyDescriptor> readProperties = 
            new ArrayList<PropertyDescriptor>();
        
        List<PropertyDescriptor> writeProperties = 
            new ArrayList<PropertyDescriptor>();

        try {
            Map<?, ?> map = CompleteIntrospector.getAllProperties(beanType);

            Iterator<?> it = map.values().iterator();
            while (it.hasNext()) {
                PropertyDescriptor pd = (PropertyDescriptor)it.next();
                if (pd.getReadMethod() != null) {
                    readProperties.add(pd);
                }
                if (pd.getWriteMethod() != null) {
                    writeProperties.add(pd);
                }
            }
        }
        catch (IntrospectionException e) {
            throw new RuntimeException(e.toString());
        }

        PropertyDescriptor[][] props = new PropertyDescriptor[2][];

        props[0] = new PropertyDescriptor[readProperties.size()];
        readProperties.toArray(props[0]);
        props[1] = new PropertyDescriptor[writeProperties.size()];
        writeProperties.toArray(props[1]);

        return props;
    }
594364
public static <T> String marshal(T obj) throws JAXBException {
    StringWriter sw = new StringWriter();
    marshal(obj, sw);
    return sw.toString();
  }
211108
protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);

        $this->setDOMElementAttribute($element, 'href', $component->getHref());

        // Deal with categories.
        $categories = $component->getCategories();
        if (count($categories) > 0) {
            $this->setDOMElementAttribute($element, 'category', implode("\x20", $categories->getArrayCopy()));
        }

        // Deal with variableMappings.
        $variableMappings = $component->getVariableMappings();
        foreach ($variableMappings as $mapping) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapping);
            $element->appendChild($marshaller->marshall($mapping));
        }

        // Deal with weights.
        $weights = $component->getWeights();
        foreach ($weights as $weight) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($weight);
            $element->appendChild($marshaller->marshall($weight));
        }

        // Deal with templateDefaults.
        $templateDefaults = $component->getTemplateDefaults();
        foreach ($templateDefaults as $default) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($default);
            $element->appendChild($marshaller->marshall($default));
        }

        return $element;
    }
1011690
public static Component getRootParent(Component component)
	{
		while (null != component.getParent())
		{
			component = component.getParent();
		}
		return component;
	}
14786
public void addToGroup(final T component) {
		ComponentGroupModel model = getOrCreateComponentModel();
		model.components.add(component);
		MemoryUtil.checkSize(model.components.size(), this.getClass().getSimpleName());
	}