Top Description Fields Constructors Methods
com.sun.tools.xjc.model

public final Class CCustomizations

extends ArrayList<CPluginCustomization>
Class Inheritance
Imports
java.util.ArrayList, .Collection, com.sun.tools.xjc.Plugin

Represents the list of CPluginCustomizations attached to a JAXB model component.

When Plugins register the customization namespace URIs through Plugin#getCustomizationURIs(), XJC will treat those URIs just like XJC's own extension "http://java.sun.com/xml/ns/xjc" and make them available as DOM nodes through CPluginCustomization. A Plugin can then access this information to change its behavior.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
public static final CCustomizations
EMPTY

Convenient singleton instance that represents an empty CCustomizations.

pack-priv CCustomizations
next

All CCustomizations used by a Model form a single linked list so that we can look for unacknowledged customizations later.

private CCustomizable
owner

The owner model component that carries these customizations.

private static final long

Constructor Summary

AccessConstructor and Description
public
public
CCustomizations(Collection<? extends CPluginCustomization> cPluginCustomizations)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.util.ArrayList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Compares the specified object with this list for equality.

public CPluginCustomization

Returns:

null if not found
find
(String nsUri)

Finds the first CPluginCustomization that belongs to the given namespace URI.

public CPluginCustomization

Returns:

null if not found
find
(String nsUri, String localName)

Finds the first CPluginCustomization that belongs to the given namespace URI and the local name.

private String
public CCustomizable

Returns:

never null.
getOwner
()

Gets the model component that carries this customization.

public int
hashCode()

Overrides java.util.ArrayList.hashCode.

Implements java.util.List.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this list.

public static CCustomizations
merge(CCustomizations lhs, CCustomizations rhs)

Merges two objects into one.

pack-priv void
Inherited from java.util.ArrayList:
addaddaddAlladdAlladdFirstaddLastclearclonecontainsensureCapacityforEachgetgetFirstgetLastindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Field Detail

EMPTYback to summary
public static final CCustomizations EMPTY

Convenient singleton instance that represents an empty CCustomizations.

nextback to summary
pack-priv CCustomizations next

All CCustomizations used by a Model form a single linked list so that we can look for unacknowledged customizations later.

See Also
CPluginCustomization#markAsAcknowledged(), setParent(Model, CCustomizable)
ownerback to summary
private CCustomizable owner

The owner model component that carries these customizations.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.ArrayList.serialVersionUID.

Constructor Detail

CCustomizationsback to summary
public CCustomizations()
CCustomizationsback to summary
public CCustomizations(Collection<? extends CPluginCustomization> cPluginCustomizations)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.util.ArrayList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Doc from java.util.ArrayList.equals.

Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if Objects.equals(e1, e2).) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.

Annotations
@Override
findback to summary
public CPluginCustomization find(String nsUri)

Finds the first CPluginCustomization that belongs to the given namespace URI.

Returns:CPluginCustomization

null if not found

findback to summary
public CPluginCustomization find(String nsUri, String localName)

Finds the first CPluginCustomization that belongs to the given namespace URI and the local name.

Returns:CPluginCustomization

null if not found

fixNullback to summary
private String fixNull(String s)
getOwnerback to summary
public CCustomizable getOwner()

Gets the model component that carries this customization.

Returns:CCustomizable

never null.

hashCodeback to summary
public int hashCode()

Overrides java.util.ArrayList.hashCode.

Implements java.util.List.hashCode, java.util.Collection.hashCode.

Doc from java.util.ArrayList.hashCode.

Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:

int hashCode = 1;
    for (E e : list)
        hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object#hashCode.
Annotations
@Override
mergeback to summary
public static CCustomizations merge(CCustomizations lhs, CCustomizations rhs)

Merges two objects into one.

setParentback to summary
pack-priv void setParent(Model model, CCustomizable owner)