public class Descriptors extends Object
This methods opperate directly on the interfaces provided by geoapi, no actual classes were harmed in the making of these utility methods.
Constructor and Description |
---|
Descriptors() |
Modifier and Type | Method and Description |
---|---|
static AttributeDescriptor |
find(List descriptors,
Name name)
Returns the attribute descriptor from a list which matches the specified name, or
null
if no such descriptor is found. |
static boolean |
isSimple(Collection<AttributeDescriptor> schema)
Determines if a collection of attribute descriptors is "simple".
|
static List |
list(AttributeType type)
Returns the list of descriptors defined in the provided schema, preserving declaration order
when relevant.
|
static int |
maxOccurs(ComplexType schema,
AttributeType type) |
static boolean |
multiple(ComplexType schema,
AttributeType type)
True if there may be more then one AttributeType in the schema.
|
static AttributeDescriptor |
node(Collection schema,
Name name)
Finds the node associated with the provided name.
|
static AttributeDescriptor |
node(ComplexType schema,
AttributeType type)
Finds the node associated with the provided type.
|
static AttributeDescriptor |
node(ComplexType schema,
Name name)
Finds the node associated with the provided name.
|
static AttributeDescriptor |
node(ComplexType schema,
String name)
Finds the first node associated with the provided name disregarding namespaces
|
static List<AttributeDescriptor> |
nodes(ComplexType schema,
AttributeType type)
List of nodes matching AttributeType.
|
static AttributeType |
type(Collection schema,
Name name)
Locate type associated with provided name, or null if not found.
|
static AttributeType |
type(ComplexType schema,
Name name)
Locate type associated with provided name, or null if not found.
|
static AttributeType |
type(ComplexType schema,
String name)
Locate type associated with provided name, or null if not found.
|
static List<AttributeType> |
types(AttributeType type)
List of types described by this schema.
|
static AttributeDescriptor |
wrapAttributeType(AttributeType type)
Wraps a
AttributeType in AttributeDescriptor . |
static List |
wrapAttributeTypes(List<AttributeType> typeList)
Wraps a list of
AttributeType in AttributeDescriptor . |
public static final List wrapAttributeTypes(List<AttributeType> typeList)
AttributeType
in AttributeDescriptor
.typeList
- The list of attribute types.wrapAttributeType(AttributeType)
public static final AttributeDescriptor wrapAttributeType(AttributeType type)
AttributeType
in AttributeDescriptor
.type
- The attribute type.public static final AttributeDescriptor find(List descriptors, Name name)
null
if no such descriptor is found.descriptors
- The list of AttributeDescriptor
.name
- The name to match.null
.public static AttributeType type(Collection schema, Name name)
Namespaces are not taken in count, so if two properties share the same local name, the first one that matches will be returned.
public static AttributeType type(ComplexType schema, String name)
Namespaces are not taken in count, so if two properties share the same local name, the first one that matches will be returned.
public static AttributeType type(ComplexType schema, Name name)
public static AttributeDescriptor node(ComplexType schema, String name)
public static AttributeDescriptor node(ComplexType schema, Name name)
public static AttributeDescriptor node(Collection schema, Name name)
public static AttributeDescriptor node(ComplexType schema, AttributeType type)
Note a type may be included in more then one node, in which case this will only find the first one.
public static List<AttributeDescriptor> nodes(ComplexType schema, AttributeType type)
public static List<AttributeType> types(AttributeType type)
On the cases where order matters, the returned list preserves the order of descriptors
declared in schema
public static boolean multiple(ComplexType schema, AttributeType type)
This may happen if:
public static int maxOccurs(ComplexType schema, AttributeType type)
public static List list(AttributeType type)
public static boolean isSimple(Collection<AttributeDescriptor> schema)
schema
- Collection of attribute descriptors.Copyright © 1996–2023 Geotools. All rights reserved.